16.6.4.6.3 Function usart_write_buffer_job()
Asynchronous buffer write.
enum status_code usart_write_buffer_job( struct usart_module *const module, uint8_t * tx_data, uint16_t length)
Sets up the driver to write a given buffer over the USART. If registered and enabled, a callback function will be called.
Data direction | Parameter name | Description |
---|---|---|
[in] |
module |
Pointer to USART software instance struct |
[in] |
tx_data |
Pointer do data buffer to transmit |
[in] |
length |
Length of the data to transmit |
#define TX_LEN 3
uint16_t tx_buf[TX_LEN] = {0x0111, 0x0022, 0x0133};
usart_write_buffer_job(&module, (uint8_t*)tx_buf, TX_LEN);
Returns
Status of the operation.
Return value | Description |
---|---|
STATUS_OK |
If operation was completed successfully. |
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 |