SAM SERCOM USART Driver.
Copyright (c) 2012-2020 Microchip Technology Inc. and its subsidiaries.
Functions | |
static enum status_code | _usart_set_config (struct usart_module *const module, const struct usart_config *const config) |
enum status_code | usart_init (struct usart_module *const module, Sercom *const hw, const struct usart_config *const config) |
Initializes the device. More... | |
enum status_code | usart_read_buffer_wait (struct usart_module *const module, uint8_t *rx_data, uint16_t length) |
Receive a buffer of length characters via the USART. More... | |
enum status_code | usart_read_wait (struct usart_module *const module, uint16_t *const rx_data) |
Receive a character via the USART. More... | |
enum status_code | usart_write_buffer_wait (struct usart_module *const module, const uint8_t *tx_data, uint16_t length) |
Transmit a buffer of characters via the USART. More... | |
enum status_code | usart_write_wait (struct usart_module *const module, const uint16_t tx_data) |
Transmit a character via the USART. More... | |
|
static |
Set Configuration of the USART module
References _sercom_get_async_baud_val(), _sercom_get_sercom_inst_index(), _sercom_get_sync_baud_val(), Assert, usart_config::baudrate, usart_config::character_size, usart_config::clock_polarity_inverted, usart_config::data_order, usart_config::ext_clock_freq, usart_config::mux_setting, usart_config::parity, usart_config::receiver_enable, usart_config::run_in_standby, SERCOM_ASYNC_OPERATION_MODE_ARITHMETIC, SERCOM_ASYNC_OPERATION_MODE_FRACTIONAL, SERCOM_ASYNC_SAMPLE_NUM_16, SERCOM_ASYNC_SAMPLE_NUM_3, SERCOM_ASYNC_SAMPLE_NUM_8, STATUS_OK, usart_config::stopbits, system_gclk_chan_get_hz(), system_is_debugger_present(), usart_config::transfer_mode, usart_config::transmitter_enable, USART_CHARACTER_SIZE_8BIT, USART_PARITY_NONE, USART_STOPBITS_1, USART_TRANSFER_ASYNCHRONOUSLY, USART_TRANSFER_SYNCHRONOUSLY, usart_config::use_external_clock, and x1.
Referenced by usart_init().