Skip to content

Commit

Permalink
Add 7-bit support to teensy4 HardwareSerial
Browse files Browse the repository at this point in the history
  • Loading branch information
ssilverman committed Nov 17, 2022
1 parent 3fdd873 commit 2b41345
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions teensy4/HardwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ void HardwareSerial::begin(uint32_t baud, uint16_t format)
ctrl |= (format & (LPUART_CTRL_PT | LPUART_CTRL_PE) ); // configure parity - turn off PT, PE, M and configure PT, PE
if (format & 0x04) ctrl |= LPUART_CTRL_M; // 9 bits (might include parity)
if ((format & 0x0F) == 0x04) ctrl |= LPUART_CTRL_R9T8; // 8N2 is 9 bit with 9th bit always 1
if ((format & 0x0E) == 0x02) ctrl |= LPUART_CTRL_M7; // 7-bit support

// Bit 5 TXINVERT
if (format & 0x20) ctrl |= LPUART_CTRL_TXINV; // tx invert
Expand Down

0 comments on commit 2b41345

Please sign in to comment.