浏览代码

HardwareSerial Half duplex add SERIAL_8N1_HALF_DUPLEX

Added in define in standard Arduino setup.

I also added for 7E1 and 7O1 as well.
main
Kurt Eckhardt 4 年前
父节点
当前提交
a19b1902e6
共有 2 个文件被更改,包括 10 次插入0 次删除
  1. +6
    -0
      teensy3/HardwareSerial.h
  2. +4
    -0
      teensy4/HardwareSerial.h

+ 6
- 0
teensy3/HardwareSerial.h 查看文件

@@ -102,7 +102,11 @@
#define SERIAL_8N2_RXINV_TXINV 0x34
#endif

// Half duplex support
#define SERIAL_HALF_DUPLEX 0x200
#define SERIAL_7E1_HALF_DUPLEX (SERIAL_7E1 | SERIAL_HALF_DUPLEX)
#define SERIAL_7O1_HALF_DUPLEX (SERIAL_7O1 | SERIAL_HALF_DUPLEX)
#define SERIAL_8N1_HALF_DUPLEX (SERIAL_8N1 | SERIAL_HALF_DUPLEX)

// bit0: parity, 0=even, 1=odd
// bit1: parity, 0=disable, 1=enable
@@ -112,6 +116,8 @@
// bit5: txinv, 0=normal, 1=inverted
// bit6: unused
// bit7: actual data goes into 9th bit
// bit8: 2 stop bits (T3.5/3.6 and LC)
// bit9: Half duplex


#if defined(KINETISK)

+ 4
- 0
teensy4/HardwareSerial.h 查看文件

@@ -93,7 +93,11 @@
#define SERIAL_8N2_TXINV (SERIAL_8N1_TXINV | SERIAL_2STOP_BITS)
#define SERIAL_8N2_RXINV_TXINV (SERIAL_8N1_RXINV_TXINV | SERIAL_2STOP_BITS)

// Half duplex support
#define SERIAL_HALF_DUPLEX 0x200
#define SERIAL_7E1_HALF_DUPLEX (SERIAL_7E1 | SERIAL_HALF_DUPLEX)
#define SERIAL_7O1_HALF_DUPLEX (SERIAL_7O1 | SERIAL_HALF_DUPLEX)
#define SERIAL_8N1_HALF_DUPLEX (SERIAL_8N1 | SERIAL_HALF_DUPLEX)

// bit0: parity, 0=even, 1=odd
// bit1: parity, 0=disable, 1=enable

正在加载...
取消
保存