I/O Stream UART

Description

I/O Stream UART.

Overview

UART layer provides a set of standard APIs that can be used with all type of UART interface.

Initialization

Each UART stream type provides its initalization with parameters specific to them.

Data Structures

struct sl_iostream_uart_t
I/O Stream UART stream object.
struct sl_iostream_descriptor_t
struct sl_iostream_dma_config_t
I/O Stream LDMA Config.
struct sl_iostream_dma_context_t
I/O Steam LDMA Context.
struct sl_iostream_uart_config_t
I/O Stream UART config.
struct sl_iostream_uart_context_t
I/O Stream UART context.

Functions

sl_status_t sl_iostream_uart_deinit ( sl_iostream_uart_t *iostream_uart)
UART Stream De-init.
void sl_iostream_uart_set_auto_cr_lf ( sl_iostream_uart_t *iostream_uart, bool on)
Configure Automatic line conversion.
bool sl_iostream_uart_get_auto_cr_lf ( sl_iostream_uart_t *iostream_uart)
Get Automatic line conversion.
void sl_iostream_uart_set_rx_energy_mode_restriction ( sl_iostream_uart_t *iostream_uart, bool on)
Add or remove energy mode restriction to enable/disable reception when the system goes to sleep.
bool sl_iostream_uart_get_rx_energy_mode_restriction ( sl_iostream_uart_t *iostream_uart)
Get reception energy mode restriction configuration.
void sl_iostream_uart_set_read_block ( sl_iostream_uart_t *iostream_uart, bool on)
Configure Read blocking mode.
bool sl_iostream_uart_get_read_block ( sl_iostream_uart_t *iostream_uart)
Get read API block configuration.

Macros

#define uartFlowControlNone 0
#define uartFlowControlSoftware 0xFFFF
#define UARTXON 0x11
#define UARTXOFF 0x13

Function Documentation

sl_iostream_uart_deinit()

sl_status_t sl_iostream_uart_deinit ( sl_iostream_uart_t * iostream_uart )
inline

UART Stream De-init.

Parameters
[in] iostream_uart UART stream object.
Returns
Status result

sl_iostream_uart_set_auto_cr_lf()

void sl_iostream_uart_set_auto_cr_lf ( sl_iostream_uart_t * iostream_uart,
bool on
)
inline

Configure Automatic line conversion.

Parameters
[in] iostream_uart UART stream object.
[in] on If true, automatic LF to CRLF conversion will be enabled.

sl_iostream_uart_get_auto_cr_lf()

bool sl_iostream_uart_get_auto_cr_lf ( sl_iostream_uart_t * iostream_uart )
inline

Get Automatic line conversion.

Parameters
[in] iostream_uart UART stream object.
Returns
Auto-conversion mode.

sl_iostream_uart_set_rx_energy_mode_restriction()

void sl_iostream_uart_set_rx_energy_mode_restriction ( sl_iostream_uart_t * iostream_uart,
bool on
)
inline

Add or remove energy mode restriction to enable/disable reception when the system goes to sleep.

Parameters
[in] iostream_uart UART context.
[in] on If true, will be able to receive data when sleeping. i.e it affects the lowest power level that the system can go. Otherwise, it might not be possible to receive data when sleeping.

sl_iostream_uart_get_rx_energy_mode_restriction()

bool sl_iostream_uart_get_rx_energy_mode_restriction ( sl_iostream_uart_t * iostream_uart )
inline

Get reception energy mode restriction configuration.

Parameters
[in] iostream_uart UART context.
Returns
Sleep configuration.

sl_iostream_uart_set_read_block()

void sl_iostream_uart_set_read_block ( sl_iostream_uart_t * iostream_uart,
bool on
)
inline

Configure Read blocking mode.

Parameters
[in] iostream_uart UART context.
[in] on If false, the read API will be non-blocking. Otherwise the read API will block until data is received.

sl_iostream_uart_get_read_block()

bool sl_iostream_uart_get_read_block ( sl_iostream_uart_t * iostream_uart )
inline

Get read API block configuration.

Parameters
[in] iostream_uart UART context.
Returns
Block mode.