Customized stdio support allowing for input and output from UART, USB, semi-hosting etc. More...

Modules

 pico_stdio_semihosting
 Experimental support for stdout using RAM semihosting.
 
 pico_stdio_uart
 Support for stdin/stdout using UART.
 
 pico_stdio_usb
 Support for stdin/stdout over USB serial (CDC)
 

Functions

void stdio_init_all (void)
 Initialize all of the present standard stdio types that are linked into the binary. More...
 
void stdio_flush (void)
 Initialize all of the present standard stdio types that are linked into the binary. More...
 
int getchar_timeout_us (uint32_t timeout_us)
 Return a character from stdin if there is one available within a timeout. More...
 
void stdio_set_driver_enabled (stdio_driver_t *driver, bool enabled)
 Adds or removes a driver from the list of active drivers used for input/output. More...
 
void stdio_filter_driver (stdio_driver_t *driver)
 Control limiting of output to a single driver. More...
 
void stdio_set_translate_crlf (stdio_driver_t *driver, bool translate)
 control conversion of line feeds to carriage return on transmissions More...
 

Detailed Description

Customized stdio support allowing for input and output from UART, USB, semi-hosting etc.

Note the API for adding additional input output devices is not yet considered stable

Function Documentation

◆ getchar_timeout_us()

int getchar_timeout_us ( uint32_t  timeout_us)

Return a character from stdin if there is one available within a timeout.

Parameters
timeout_usthe timeout in microseconds, or 0 to not wait for a character if none available.
Returns
the character from 0-255 or PICO_ERROR_TIMEOUT if timeout occurs

◆ stdio_filter_driver()

void stdio_filter_driver ( stdio_driver_t driver)

Control limiting of output to a single driver.

Note
this method should always be called on an initialized driver
Parameters
driverif non-null then output only that driver will be used for input/output (assuming it is in the list of enabled drivers). if NULL then all enabled drivers will be used

◆ stdio_flush()

void stdio_flush ( void  )

Initialize all of the present standard stdio types that are linked into the binary.

Call this method once you have set up your clocks to enable the stdio support for UART, USB and semihosting based on the presence of the respective libraries in the binary.

See also
stdio_uart, stdio_usb, stdio_semihosting

◆ stdio_init_all()

void stdio_init_all ( void  )

Initialize all of the present standard stdio types that are linked into the binary.

Call this method once you have set up your clocks to enable the stdio support for UART, USB and semihosting based on the presence of the respective libraries in the binary.

See also
stdio_uart, stdio_usb, stdio_semihosting

◆ stdio_set_driver_enabled()

void stdio_set_driver_enabled ( stdio_driver_t driver,
bool  enabled 
)

Adds or removes a driver from the list of active drivers used for input/output.

Note
this method should always be called on an initialized driver
Parameters
driverthe driver
enabledtrue to add, false to remove

◆ stdio_set_translate_crlf()

void stdio_set_translate_crlf ( stdio_driver_t driver,
bool  translate 
)

control conversion of line feeds to carriage return on transmissions

Note
this method should always be called on an initialized driver
Parameters
driverthe driver
translateIf true, convert line feeds to carriage return on transmissions