From 2b41345e1ee452482bb37f39282d0400d12fe18a Mon Sep 17 00:00:00 2001 From: Shawn Silverman Date: Wed, 16 Nov 2022 16:13:04 -0800 Subject: [PATCH] Add 7-bit support to teensy4 HardwareSerial --- teensy4/HardwareSerial.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/teensy4/HardwareSerial.cpp b/teensy4/HardwareSerial.cpp index fe3cb08f0..444da998e 100644 --- a/teensy4/HardwareSerial.cpp +++ b/teensy4/HardwareSerial.cpp @@ -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