16.6.4.6.4 Function usart_read_buffer_job()
Asynchronous buffer read.
enum status_code usart_read_buffer_job( struct usart_module *const module, uint8_t * rx_data, uint16_t length)
Sets up the driver to read from the USART to a given buffer. If registered and enabled, a callback function will be called.
Data direction | Parameter name | Description |
---|---|---|
[in] |
module |
Pointer to USART software instance struct |
[out] |
rx_data |
Pointer to data buffer to receive |
[in] |
length |
Data buffer length |
#define RX_LEN 3
uint16_t rx_buf[RX_LEN] = {0x0,};
usart_read_buffer_job(&module, (uint8_t*)rx_buf, RX_LEN);
Returns
Status of the operation.
Return value | Description |
---|---|
STATUS_OK |
If operation was completed |
STATUS_BUSY |
If operation was not completed, due to the USART module being busy |
STATUS_ERR_INVALID_ARG |
If operation was not completed, due to invalid arguments |
STATUS_ERR_DENIED |
If the transmitter is not enabled |