Support for stdin/stdout using UART. More...

Functions

void stdio_uart_init (void)
 Explicitly initialize stdin/stdout over UART and add it to the current set of stdin/stdout drivers. More...
 
void stdout_uart_init (void)
 Explicitly initialize stdout only (no stdin) over UART and add it to the current set of stdout drivers. More...
 
void stdin_uart_init (void)
 Explicitly initialize stdin only (no stdout) over UART and add it to the current set of stdin drivers. More...
 
void stdio_uart_init_full (uart_inst_t *uart, uint baud_rate, int tx_pin, int rx_pin)
 Perform custom initialization initialize stdin/stdout over UART and add it to the current set of stdin/stdout drivers. More...
 

Detailed Description

Support for stdin/stdout using UART.

Linking this library or calling pico_enable_stdio_uart(TARGET ENABLED) in the CMake (which achieves the same thing) will add UART to the drivers used for standard input/output

Function Documentation

◆ stdin_uart_init()

void stdin_uart_init ( void  )

Explicitly initialize stdin only (no stdout) over UART and add it to the current set of stdin drivers.

This method sets up PICO_DEFAULT_UART_RX_PIN for UART input (if defined) , and configures the baud rate as PICO_DEFAULT_UART_BAUD_RATE

◆ stdio_uart_init()

void stdio_uart_init ( void  )

Explicitly initialize stdin/stdout over UART and add it to the current set of stdin/stdout drivers.

This method sets up PICO_DEFAULT_UART_TX_PIN for UART output (if defined), PICO_DEFAULT_UART_RX_PIN for input (if defined) and configures the baud rate as PICO_DEFAULT_UART_BAUD_RATE.

Note
this method is automatically called by stdio_init_all() if pico_stdio_uart is included in the build

◆ stdio_uart_init_full()

void stdio_uart_init_full ( uart_inst_t *  uart,
uint  baud_rate,
int  tx_pin,
int  rx_pin 
)

Perform custom initialization initialize stdin/stdout over UART and add it to the current set of stdin/stdout drivers.

Parameters
uartthe uart instance to use, uart0 or uart1
baud_ratethe baud rate in Hz
tx_pinthe UART pin to use for stdout (or -1 for no stdout)
rx_pinthe UART pin to use for stdin (or -1 for no stdin)

◆ stdout_uart_init()

void stdout_uart_init ( void  )

Explicitly initialize stdout only (no stdin) over UART and add it to the current set of stdout drivers.

This method sets up PICO_DEFAULT_UART_TX_PIN for UART output (if defined) , and configures the baud rate as PICO_DEFAULT_UART_BAUD_RATE