Skip to content

Commit

Permalink
Update HardwareSerial.h Adding 9N1 support
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vashadow authored Oct 5, 2024
1 parent 4a02bfc commit 5c264a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ namespace arduino {
#define SERIAL_DATA_6 (0x200ul)
#define SERIAL_DATA_7 (0x300ul)
#define SERIAL_DATA_8 (0x400ul)
#define SERIAL_DATA_9 (0x500ul)
#define SERIAL_DATA_MASK (0xF00ul)

#define SERIAL_5N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_5)
#define SERIAL_6N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_6)
#define SERIAL_7N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_7)
#define SERIAL_8N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_8)
#define SERIAL_9N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_9)
#define SERIAL_5N2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_NONE | SERIAL_DATA_5)
#define SERIAL_6N2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_NONE | SERIAL_DATA_6)
#define SERIAL_7N2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_NONE | SERIAL_DATA_7)
Expand Down Expand Up @@ -103,4 +105,4 @@ class HardwareSerial : public Stream
// XXX: Are we keeping the serialEvent API?
extern void serialEventRun(void) __attribute__((weak));

}
}

0 comments on commit 5c264a8

Please sign in to comment.