[][src]Type Definition rpi_pico_sdk::uart_inst_t

type uart_inst_t = uart_inst;

\file hardware/uart.h \defgroup hardware_uart hardware_uart

Hardware UART API

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.

\subsection uart_example Example \addtogroup hardware_uart

\code int main() {

// Initialise UART 0
uart_init(uart0, 115200);

// Set the GPIO pin mux to the UART - 0 is TX, 1 is RX
gpio_set_function(0, GPIO_FUNC_UART);
gpio_set_function(1, GPIO_FUNC_UART);

uart_puts(uart0, "Hello world!");

} \endcode