Skip to content

Commit 5c264a8

Browse files
authored
Update HardwareSerial.h Adding 9N1 support
I added two define statements to allow boards like the UNO R4 WIFI to use their 9-bit UART via the 16-bit register. This is to support a pull request coming to the renesas_uno core to activate and facilitate the processor's 9-bit functionality.
1 parent 4a02bfc commit 5c264a8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: api/HardwareSerial.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ namespace arduino {
4242
#define SERIAL_DATA_6 (0x200ul)
4343
#define SERIAL_DATA_7 (0x300ul)
4444
#define SERIAL_DATA_8 (0x400ul)
45+
#define SERIAL_DATA_9 (0x500ul)
4546
#define SERIAL_DATA_MASK (0xF00ul)
4647

4748
#define SERIAL_5N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_5)
4849
#define SERIAL_6N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_6)
4950
#define SERIAL_7N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_7)
5051
#define SERIAL_8N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_8)
52+
#define SERIAL_9N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_9)
5153
#define SERIAL_5N2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_NONE | SERIAL_DATA_5)
5254
#define SERIAL_6N2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_NONE | SERIAL_DATA_6)
5355
#define SERIAL_7N2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_NONE | SERIAL_DATA_7)
@@ -103,4 +105,4 @@ class HardwareSerial : public Stream
103105
// XXX: Are we keeping the serialEvent API?
104106
extern void serialEventRun(void) __attribute__((weak));
105107

106-
}
108+
}

0 commit comments

Comments
 (0)