Skip to content

Commit

Permalink
HardwareSerial Half duplex add SERIAL_8N1_HALF_DUPLEX
Browse files Browse the repository at this point in the history
Added in define in standard Arduino setup.

I also added for 7E1 and 7O1 as well.
  • Loading branch information
KurtE committed Sep 10, 2020
1 parent 98f01a0 commit a19b190
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions teensy3/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions teensy4/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a19b190

Please sign in to comment.