High Level functions for UART.
More...
High Level functions for UART.
◆ uart_put_non_blocking()
Initiates a non-blocking transmit operation over UART for the specified instance. Data is written to the UART transmit FIFO and the function returns immediately. If there is more data to write the interrupt is configured to write the remainder. Completion is handled via callback.
- Parameters
-
| id | UART Instance ID. |
| put_config | Pointer to the transmit configuration structure. |
- Returns
- uart_status_en Status code indicating success or the reason for failure.
◆ uart_get_non_blocking()
Initiates a non-blocking receive operation over UART for the specified instance. Attempts to read data from the UART receive FIFO into the provided buffer and returns immediately with the number of bytes received so far. If there is still data to receive the interrupt is configured to read the remainder. Completion is handled via callback.
- Parameters
-
| id | UART Instance ID. |
| xfer | Pointer to the receive configuration structure. |
| received_chars | Pointer to a variable that stores the number of bytes already available in the RX FIFO |
- Returns
- uart_status_en Status code indicating success or the reason for failure.
◆ uart_abort_put()
Aborts any ongoing UART transmit (put) operation for the specified instance, releasing the transmitter and resetting the transmit state to idle.
- Parameters
-
- Returns
- uart_status_en Status code indicating success or the reason for failure.
◆ uart_abort_get()
Aborts any ongoing UART receive (get) operation for the specified instance, releasing the receiver and resetting the receive state to idle. The RX FIFO will be retained.
- Parameters
-
- Returns
- uart_status_en Status code indicating success or the reason for failure.
◆ uart_get_num_transmitted()
Returns number of characters that have been shifted out since last call to uart_put_non_blocking for the specified instance.
- Parameters
-
- Returns
- Number of bytes transmitted.
◆ uart_get_num_received()
Returns number of characters that have been written into user buffer since last call to uart_get_non_blocking for the specified instance.
- Parameters
-
- Returns
- Number of bytes received.
◆ uart_get_put_status()
Returns the current transmit status of the UART for the specified instance.
- Parameters
-
- Returns
- uart_put_status_en - Transmit status:
- TX_IN_PROGRESS
- TX_COMPLETE
- TX_ERROR
◆ uart_get_get_status()
Returns the current receive status of the UART for the specified instance.
- Parameters
-
- Returns
- uart_get_status_en - Receive status:
- RX_IN_PROGRESS
- RX_COMPLETE
- RX_ERROR