16.6.4.2.3 Function usart_write_buffer_wait()
Transmit a buffer of characters via the USART.
enum status_code usart_write_buffer_wait( struct usart_module *const module, const uint8_t * tx_data, uint16_t length)
This blocking function will transmit a block of length characters via the USART.
Data direction | Parameter name | Description |
---|---|---|
[in] |
module |
Pointer to USART software instance struct |
[in] |
tx_data |
Pointer to data to transmit |
[in] |
length |
Number of characters to transmit |
#define TX_LEN 3
uint16_t tx_buf[TX_LEN] = {0x0111, 0x0022, 0x0133};
usart_write_buffer_wait(&module, (uint8_t*)tx_buf, TX_LEN);
Returns
Status of the operation.
Return value | Description |
---|---|
STATUS_OK |
If operation was completed |
STATUS_ERR_INVALID_ARG |
If operation was not completed, due to invalid arguments |
STATUS_ERR_TIMEOUT |
If operation was not completed, due to USART module timing out |
STATUS_ERR_DENIED |
If the transmitter is not enabled |