38.1.5.1 usart_async_init
Initialize USART interface.
int32_t usart_async_init(
struct usart_async_descriptor *const descr,
void *const hw,
uint8_t *const rx_buffer,
const uint16_t rx_buffer_length,
void *const func
)
This function initializes the given I/O descriptor to be used as USART interface descriptor. It checks if the given hardware is not initialized and if the given hardware is permitted to be initialized.
Parameters
- descr
-
Type: struct usart_async_descriptor Struct *const
A USART descriptor which is used to communicate via the USART
- hw
-
Type: void *const
The pointer to the hardware instance
- rx_buffer
-
Type: uint8_t *const
An RX buffer
- rx_buffer_length
-
Type: const uint16_t
The length of the buffer above
- func
-
Type: void *const
The pointer to a set of function pointers
Returns
Type: int32_t
Initialization status.
- -1
-
Passed parameters were invalid or the interface is already initialized
- 0
-
The initialization is completed successfully