UART functions.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
static Usart * | get_usart (uint8_t port) |
ISR (USART_HANDLER_0) | |
ISR (USART_HANDLER_1) | |
void | uart_close (uint8_t port) |
Closes communication line. More... | |
void | uart_config (uint8_t port, usb_cdc_line_coding_t *cfg) |
Configures communication line. More... | |
void | uart_open (uint8_t port) |
Opens communication line. More... | |
void | uart_rx_notify (uint8_t port) |
Called by CDC interface Callback running when CDC device have received data. More... | |
static void | usart_handler (uint8_t port) |
Variables | |
static sam_usart_opt_t | usart_options |
|
static |
References NULL.
Referenced by uart_config(), uart_open(), uart_rx_notify(), and usart_handler().
ISR | ( | USART_HANDLER_0 | ) |
References usart_handler.
ISR | ( | USART_HANDLER_1 | ) |
References usart_handler.
void uart_close | ( | uint8_t | port | ) |
Closes communication line.
References usart_disable_interrupt().
void uart_config | ( | uint8_t | port, |
usb_cdc_line_coding_t * | cfg | ||
) |
Configures communication line.
cfg | line configuration |
References sam_usart_opt_t::baudrate, usb_cdc_line_coding_t::bCharFormat, usb_cdc_line_coding_t::bDataBits, usb_cdc_line_coding_t::bParityType, CDC_PAR_EVEN, CDC_PAR_MARK, CDC_PAR_NONE, CDC_PAR_ODD, CDC_PAR_SPACE, CDC_STOP_BITS_1, CDC_STOP_BITS_1_5, CDC_STOP_BITS_2, sam_usart_opt_t::channel_mode, sam_usart_opt_t::char_length, usb_cdc_line_coding_t::dwDTERate, get_usart(), LE32_TO_CPU, sam_usart_opt_t::parity_type, sam_usart_opt_t::stop_bits, sysclk_get_peripheral_hz(), usart_disable_interrupt(), usart_enable_interrupt(), usart_enable_rx(), usart_enable_tx(), usart_get_interrupt_mask(), and usart_init_rs232().
void uart_open | ( | uint8_t | port | ) |
Opens communication line.
References get_usart(), pmc_enable_periph_clk(), sysclk_get_peripheral_hz(), usart_enable_interrupt(), usart_enable_rx(), usart_enable_tx(), and usart_init_rs232().
void uart_rx_notify | ( | uint8_t | port | ) |
Called by CDC interface Callback running when CDC device have received data.
References get_usart(), usart_enable_interrupt(), usart_enable_tx(), and usart_get_interrupt_mask().
|
static |
References get_usart(), udi_cdc_multi_getc(), udi_cdc_multi_is_rx_ready(), udi_cdc_multi_is_tx_ready(), udi_cdc_multi_putc(), udi_cdc_multi_signal_framing_error(), udi_cdc_multi_signal_overrun(), ui_com_error(), ui_com_overflow(), ui_com_rx_start(), ui_com_rx_stop(), ui_com_tx_start(), ui_com_tx_stop(), usart_disable_interrupt(), usart_disable_tx(), usart_enable_rx(), usart_get_status(), usart_read(), usart_reset_rx(), and usart_write().
|
static |