Retarget IO (retarget-io-cat3)
Retarget IO

General Description

Data Structures

struct  cy_retarget_io_uart_t
 UART channel handle. More...
 

Macros

#define CY_RETARGET_IO_CONVERT_LF_TO_CRLF
 Defining this macro enables conversion of line feed (LF) into carriage return followed by line feed (CR & LF) on the output direction (STDOUT). More...
 

Functions

cy_rslt_t cy_retarget_io_init (XMC_USIC_CH_t *channel)
 Initialization function for redirecting low level IO commands to allow sending messages over a UART interface. More...
 
bool cy_retarget_io_is_tx_active ()
 Checks whether the data is currently written to the serial console. More...
 
void cy_retarget_io_deinit (void)
 Releases the UART interface allowing it to be used for other purposes. More...
 

Variables

cy_retarget_io_uart_t cy_retarget_io_uart_obj
 UART channel handle used by this library.
 

Data Structure Documentation

◆ cy_retarget_io_uart_t

struct cy_retarget_io_uart_t
Data Fields
XMC_USIC_CH_t * channel

Macro Definition Documentation

◆ CY_RETARGET_IO_CONVERT_LF_TO_CRLF

#define CY_RETARGET_IO_CONVERT_LF_TO_CRLF

Defining this macro enables conversion of line feed (LF) into carriage return followed by line feed (CR & LF) on the output direction (STDOUT).

You can define this macro through the DEFINES variable in the application Makefile.

Function Documentation

◆ cy_retarget_io_init()

cy_rslt_t cy_retarget_io_init ( XMC_USIC_CH_t *  channel)

Initialization function for redirecting low level IO commands to allow sending messages over a UART interface.

Note
This function doesn't perform configuration of the USIC peripheral channel or Tx/Rx pins. The hardware resources must be already configured before calling this function.

In an RTOS environment, this function must be called after the RTOS has been initialized.

Parameters
channelPointer to USIC channel handler
Returns
CY_RSLT_SUCCESS if successfully initialized, else an error about what went wrong

◆ cy_retarget_io_is_tx_active()

bool cy_retarget_io_is_tx_active ( )

Checks whether the data is currently written to the serial console.

Returns
true if there are pending TX transactions, otherwise false

◆ cy_retarget_io_deinit()

void cy_retarget_io_deinit ( void  )

Releases the UART interface allowing it to be used for other purposes.

After calling this, printf and related functions will no longer work.