diff options
| author | robert-hh <robert@hammelrath.com> | 2022-08-26 16:42:10 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-08-31 00:18:27 +1000 |
| commit | 8804993d0f5326fd71f137433a1b52199d65f119 (patch) | |
| tree | 0c2c8e6dfabea073dd09cac51b7c3f00be8c52b0 /ports/esp8266/uart.h | |
| parent | 49e17c8bb0c55d8efb3f768ba1dfd5b27c466b26 (diff) | |
esp8266/machine_uart: Implement uart.flush() and uart.txdone().
uart.flush()
flush() will wait until all characters but the last one have been sent.
It returns while the last character is sent. If needed, the calling
code has to add one character wait time. To avoid a permanent lock,
a timeout applies depending on the size of the FIFO and the baud rate.
ret = uart.txdone()
ret is True if no transfer is in progress. It returns already True when
the last byte of a transfer is sent.
ret is False otherwise.
Diffstat (limited to 'ports/esp8266/uart.h')
| -rw-r--r-- | ports/esp8266/uart.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ports/esp8266/uart.h b/ports/esp8266/uart.h index de0919bde..3c5592ff0 100644 --- a/ports/esp8266/uart.h +++ b/ports/esp8266/uart.h @@ -101,6 +101,7 @@ bool uart_rx_wait(uint32_t timeout_us); int uart_rx_char(void); void uart_tx_one_char(uint8 uart, uint8 TxChar); void uart_flush(uint8 uart); +int uart_txdone(uint8 uart); void uart_os_config(int uart); void uart_setup(uint8 uart); int uart0_get_rxbuf_len(void); |
