I/O Stream USART
I/O Stream USART.
The Universal Synchronous / Asynchronous Receiver / Transmitter controller(s) (USART) 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 USART peripheral. The flow control is supported as well.
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-USART adds a requirement on EM1 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 is added if the application can receive data asynchronously. Meaning that the system can receive data when the MCU is into a sleep mode(will always be EM1 to allow the reception). 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:
|I/O Stream USART config. |
|I/O Stream USART context. |
|sl_status_t||sl_iostream_usart_init (sl_iostream_uart_t *iostream_uart, sl_iostream_uart_config_t *uart_config, USART_InitAsync_TypeDef *init, sl_iostream_usart_config_t *usart_config, sl_iostream_usart_context_t *usart_context)|
|USART Stream init. |
|void||sl_iostream_usart_irq_handler (void *stream_context)|
|Usart interrupt handler. |
|sl_status_t sl_iostream_usart_init||(||sl_iostream_uart_t *||
USART Stream init.
I/O Stream UART handle. [in]
I/O Stream UART config. [in]
USART initialization modes. [in]
USART configuration. [in]
USART Instance context.
- Status result
|void sl_iostream_usart_irq_handler||(||void *||)|
Usart interrupt handler.
Usart stream context.