|
static uint | uart_get_index (uart_inst_t *uart) |
| Convert UART instance to hardware instance number. More...
|
|
uint | uart_init (uart_inst_t *uart, uint baudrate) |
| Initialise a UARTPut the UART into a known state, and enable it. Must be called before other functions. More...
|
|
void | uart_deinit (uart_inst_t *uart) |
| DeInitialise a UARTDisable the UART if it is no longer used. Must be reinitialised before being used again. More...
|
|
uint | uart_set_baudrate (uart_inst_t *uart, uint baudrate) |
| Set UART baud rateSet baud rate as close as possible to requested, and return actual rate selected. More...
|
|
static void | uart_set_hw_flow (uart_inst_t *uart, bool cts, bool rts) |
| Set UART flow control CTS/RTS. More...
|
|
static void | uart_set_format (uart_inst_t *uart, uint data_bits, uint stop_bits, uart_parity_t parity) |
| Set UART data formatConfigure the data format (bits etc() for the UART. More...
|
|
static void | uart_set_irq_enables (uart_inst_t *uart, bool rx_has_data, bool tx_needs_data) |
| Setup UART interruptsEnable the UART's interrupt output. An interrupt handler will need to be installed prior to calling this function. More...
|
|
static bool | uart_is_enabled (uart_inst_t *uart) |
| Test if specific UART is enabled. More...
|
|
static void | uart_set_fifo_enabled (uart_inst_t *uart, bool enabled) |
| Enable/Disable the FIFOs on specified UART. More...
|
|
static bool | uart_is_writable (uart_inst_t *uart) |
| Determine if space is available in the TX FIFO. More...
|
|
static void | uart_tx_wait_blocking (uart_inst_t *uart) |
| Wait for the UART TX fifo to be drained. More...
|
|
static bool | uart_is_readable (uart_inst_t *uart) |
| Determine whether data is waiting in the RX FIFO. More...
|
|
static void | uart_write_blocking (uart_inst_t *uart, const uint8_t *src, size_t len) |
| Write to the UART for transmission.This function will block until all the data has been sent to the UART. More...
|
|
static void | uart_read_blocking (uart_inst_t *uart, uint8_t *dst, size_t len) |
| Read from the UARTThis function blocks until len characters have been read from the UART. More...
|
|
static void | uart_putc_raw (uart_inst_t *uart, char c) |
| Write single character to UART for transmission.This function will block until the entire character has been sent. More...
|
|
static void | uart_putc (uart_inst_t *uart, char c) |
| Write single character to UART for transmission, with optional CR/LF conversionsThis function will block until the character has been sent. More...
|
|
static void | uart_puts (uart_inst_t *uart, const char *s) |
| Write string to UART for transmission, doing any CR/LF conversionsThis function will block until the entire string has been sent. More...
|
|
static char | uart_getc (uart_inst_t *uart) |
| Read a single character from the UARTThis function will block until a character has been read. More...
|
|
static void | uart_set_break (uart_inst_t *uart, bool en) |
| Assert a break condition on the UART transmission. More...
|
|
void | uart_set_translate_crlf (uart_inst_t *uart, bool translate) |
| Set CR/LF conversion on UART. More...
|
|
static void | uart_default_tx_wait_blocking (void) |
| Wait for the default UART's TX FIFO to be drained.
|
|
bool | uart_is_readable_within_us (uart_inst_t *uart, uint32_t us) |
| Wait for up to a certain number of microseconds for the RX FIFO to be non empty. More...
|
|
static uint | uart_get_dreq (uart_inst_t *uart, bool is_tx) |
| Return the DREQ to use for pacing transfers to/from a particular UART instance. More...
|
|
#define | uart0 ((uart_inst_t *)uart0_hw) |
| Identifier for UART instance 0. More...
|
|
#define | uart1 ((uart_inst_t *)uart1_hw) |
| Identifier for UART instance 1.
|
|
RP2040 has 2 identical instances of a UART peripheral, based on the ARM PL011. Each UART can be connected to a number of GPIO pins as defined in the GPIO muxing.
Only the TX, RX, RTS, and CTS signals are connected, meaning that the modem mode and IrDA mode of the PL011 are not supported.