I/O Stream EUSART
Description
I/O Stream EUSART.
Overview
The Enhanced Universal Synchronous / Asynchronous Receiver / Transmitter controller(s) (EUSART) can be used as a UART and can, therefore, be connected to an external transceiver to communicate with another host using the serial link. Multiple instances can be instantiated as long as they are bound to a unique EUSART peripheral. The flow control is supported as well.
Initialization
The stream sets itself as the default stream at the end of the initialization function.You must reconfigure the default interface if you have multiple streams in your project else the last stream initialized will be set as the system default stream.
Power manager integration
On transmission side, I/O Stream-EUSART adds a requirement on EM1 or EM2, depending on the frequency mode, until the transmit is really completed. Once the transmit is completed the requirement is removed and the system can go to a lower energy mode if allowed.
On the receive side, a requirement on EM1 or EM2, depending on the frequency mode, is added if the application can receive data asynchronously. Meaning that the system can receive data when the MCU is in sleep mode (EM1 or EM2 to allow the reception). Allowing the reception in sleep mode will obviously increase the power consumption. Otherwise, If the system doesn't expect to receive anything, no requirement is added and the system can go to the lowest Energy mode allowed. You can control this behavior using a configuration per instance, see the following configuration:
SL_IOSTREAM_EUSART_<instance_name>_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION
Data Structures |
|
struct | sl_iostream_eusart_config_t |
Struct representing an I/O Stream EUSART configuration.
|
|
struct | sl_iostream_eusart_context_t |
Struct representing an I/O Stream EUSART context.
|
|
Functions |
|
sl_status_t | sl_iostream_eusart_init ( sl_iostream_uart_t *iostream_uart, sl_iostream_uart_config_t *uart_config, EUSART_UartInit_TypeDef *init, sl_iostream_eusart_config_t *eusart_config, sl_iostream_eusart_context_t *eusart_context) |
EUSART Stream init.
|
|
void | sl_iostream_eusart_irq_handler ( sl_iostream_uart_t *iostream_uart) |
EUSART interrupt handler.
|
|
Function Documentation
◆ sl_iostream_eusart_init()
sl_status_t sl_iostream_eusart_init | ( | sl_iostream_uart_t * |
iostream_uart,
|
sl_iostream_uart_config_t * |
uart_config,
|
||
EUSART_UartInit_TypeDef * |
init,
|
||
sl_iostream_eusart_config_t * |
eusart_config,
|
||
sl_iostream_eusart_context_t * |
eusart_context
|
||
) |
EUSART Stream init.
- Parameters
-
[in] iostream_uart
I/O Stream UART handle. [in] uart_config
I/O Stream UART config. [in] init
UART initialization modes. [in] eusart_config
EUSART configuration. [in] eusart_context
EUSART Instance context.
- Returns
- Status result
◆ sl_iostream_eusart_irq_handler()
void sl_iostream_eusart_irq_handler | ( | sl_iostream_uart_t * |
iostream_uart
|
) |
EUSART interrupt handler.
- Parameters
-
[in] iostream_uart
I/O Stream UART handle.