16.6.4.2.2 Function usart_read_wait()

Receive a character via the USART.

enum status_code usart_read_wait( struct usart_module *const module, uint16_t *const rx_data)

This blocking function will receive a character via the USART.

Table 16-9. Parameters
Data directionParameter nameDescription

[in]

module

Pointer to the software instance struct

[out]

rx_data

Pointer to received data

Returns

Status of the operation.

Table 16-10. Return Values
Return valueDescription

STATUS_OK

If the operation was completed

STATUS_BUSY

If the operation was not completed, due to the USART module being busy

STATUS_ERR_BAD_FORMAT

If the operation was not completed, due to configuration mismatch between USART and the sender

STATUS_ERR_BAD_OVERFLOW

If the operation was not completed, due to the baudrate being too low or the system frequency being too high

STATUS_ERR_BAD_DATA

If the operation was not completed, due to data being corrupted

STATUS_ERR_DENIED

If the receiver is not enabled