USART Serial wrapper service for the SAM D/L/C/R devices.
Copyright (c) 2009-2018 Microchip Technology Inc. and its subsidiaries.
Serial Management Configuration | |
typedef Sercom * | usart_inst_t |
static bool | usart_serial_init (struct usart_module *const module, usart_inst_t const hw, const struct usart_config *const config) |
Initializes the Usart in serial mode. More... | |
static enum status_code | usart_serial_putchar (struct usart_module *const module, uint8_t c) |
Sends a character with the USART. More... | |
static void | usart_serial_getchar (struct usart_module *const module, uint8_t *c) |
Waits until a character is received, and returns it. More... | |
static enum status_code | usart_serial_write_packet (struct usart_module *const module, const uint8_t *tx_data, uint16_t length) |
Send a sequence of bytes to USART device. More... | |
static enum status_code | usart_serial_read_packet (struct usart_module *const module, uint8_t *rx_data, uint16_t length) |
Receive a sequence of bytes from USART device. More... | |
typedef Sercom* usart_inst_t |
|
inlinestatic |
Waits until a character is received, and returns it.
[in,out] | module | Software instance of the USART. |
[out] | c | Destination for the read character. |
References STATUS_OK, and usart_read_wait().
|
inlinestatic |
Initializes the Usart in serial mode.
[in,out] | module | Software instance of the USART to initialize. |
[in] | hw | Base address of the hardware USART. |
[in] | config | Configuration settings for the USART. |
true | if the initialization was successful |
false | if initialization failed (error in baud rate calculation) |
References STATUS_OK, and usart_init().
Referenced by sio2ncp_init().
|
inlinestatic |
Sends a character with the USART.
[in,out] | module | Software instance of the USART. |
[in] | c | Character to write. |
References STATUS_OK, and usart_write_wait().
|
inlinestatic |
Receive a sequence of bytes from USART device.
[in,out] | module | Software instance of the USART. |
[out] | rx_data | Data buffer to store the read data into. |
[in] | length | Length of data to read. |
References usart_read_buffer_wait().
|
inlinestatic |
Send a sequence of bytes to USART device.
[in,out] | module | Software instance of the USART. |
[in] | tx_data | Data buffer to read the data to write from. |
[in] | length | Length of data to write. |
References usart_write_buffer_wait().
Referenced by sio2host_tx(), and sio2ncp_tx().