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.
Data direction | Parameter name | Description |
---|---|---|
[in] |
module |
Pointer to the software instance struct |
[out] |
rx_data |
Pointer to received data |
Returns
Status of the operation.
Return value | Description |
---|---|
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 |