Adds UART RX IRQ Callback with onReceive() (#6134)

* Adds UART RX IRQ Callback with onReceive()
This commit is contained in:
Rodrigo Garcia
2022-01-17 11:04:12 -03:00
committed by GitHub
parent 5ae3886c66
commit c014eaf352
4 changed files with 93 additions and 8 deletions

View File

@ -57,6 +57,10 @@ class HardwareSerial: public Stream
public:
HardwareSerial(int uart_nr);
// onReceive will setup a callback for whenever UART data is received
// it will work as UART Rx interrupt
void onReceive(void(*function)(void));
void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1, bool invert=false, unsigned long timeout_ms = 20000UL, uint8_t rxfifo_full_thrhd = 112);
void end(bool turnOffDebug = true);
void updateBaudRate(unsigned long baud);