UART functions.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
void | uart_close (void) |
Closes communication line. More... | |
void | uart_config (usb_cdc_line_coding_t *cfg) |
Configures communication line. More... | |
void | uart_open (void) |
Opens communication line. More... | |
void | uart_rx_notify (void) |
Callback called by CDC interface when the CDC device has received data. More... | |
static void | usart_rx_callback (struct usart_module *const module) |
USART interrupt callback function. More... | |
static void | usart_tx_callback (struct usart_module *const module) |
USART interrupt callback function. More... | |
Variables | |
static uint8_t | rx_data |
static volatile uint8_t | tx_callback_flag = 0 |
static uint8_t | tx_data |
struct usart_config | usart_conf |
struct usart_module | usart_module_edbg |
void uart_close | ( | void | ) |
Closes communication line.
References usart_disable(), and usart_module_edbg.
void uart_config | ( | usb_cdc_line_coding_t * | cfg | ) |
Configures communication line.
cfg | pointer on line configuration descriptor |
References usart_config::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, usart_config::character_size, CONF_USART_BASE, CONF_USART_MUX_SETTING, CONF_USART_PINMUX_PAD0, CONF_USART_PINMUX_PAD1, CONF_USART_PINMUX_PAD2, CONF_USART_PINMUX_PAD3, usb_cdc_line_coding_t::dwDTERate, LE32_TO_CPU, usart_config::mux_setting, usart_config::parity, usart_config::pinmux_pad0, usart_config::pinmux_pad1, usart_config::pinmux_pad2, usart_config::pinmux_pad3, rx_data, usart_config::stopbits, USART_CALLBACK_BUFFER_RECEIVED, USART_CALLBACK_BUFFER_TRANSMITTED, USART_CHARACTER_SIZE_5BIT, USART_CHARACTER_SIZE_6BIT, USART_CHARACTER_SIZE_7BIT, USART_CHARACTER_SIZE_8BIT, usart_conf, usart_disable(), usart_enable(), usart_enable_callback(), usart_get_config_defaults(), usart_init(), usart_module_edbg, USART_PARITY_EVEN, USART_PARITY_NONE, USART_PARITY_ODD, usart_read_buffer_job(), usart_register_callback(), usart_rx_callback(), USART_STOPBITS_1, USART_STOPBITS_2, and usart_tx_callback().
Referenced by ui_usb_enum_event().
void uart_open | ( | void | ) |
Opens communication line.
References usart_enable(), and usart_module_edbg.
Referenced by ui_usb_enum_event().
void uart_rx_notify | ( | void | ) |
Callback called by CDC interface when the CDC device has received data.
References tx_callback_flag, tx_data, uhi_cdc_getc(), ui_com_rx_start(), USART_CALLBACK_BUFFER_TRANSMITTED, usart_enable_callback(), usart_module_edbg, and usart_write_buffer_job().
|
static |
USART interrupt callback function.
Called by USART driver when receiving is complete.
module | USART module causing the interrupt (not used) |
References rx_data, uhi_cdc_is_tx_ready(), uhi_cdc_putc(), ui_com_overflow(), ui_com_tx_start(), ui_com_tx_stop(), usart_module_edbg, and usart_read_buffer_job().
Referenced by uart_config().
|
static |
USART interrupt callback function.
Called by USART driver when transmit is complete.
module | USART module causing the interrupt (not used) |
References tx_callback_flag, tx_data, uhi_cdc_getc(), uhi_cdc_is_rx_ready(), ui_com_rx_start(), ui_com_rx_stop(), USART_CALLBACK_BUFFER_TRANSMITTED, usart_disable_callback(), usart_module_edbg, and usart_write_buffer_job().
Referenced by uart_config().
|
static |
Referenced by _usart_read_buffer(), uart_config(), uhi_cdc_getc(), and usart_rx_callback().
|
static |
Referenced by uart_rx_notify(), and usart_tx_callback().
|
static |
Referenced by _usart_write_buffer(), uart_rx_notify(), usart_tx_callback(), and usart_write_wait().
struct usart_config usart_conf |
Referenced by uart_config().
struct usart_module usart_module_edbg |
Referenced by uart_close(), uart_config(), uart_open(), uart_rx_notify(), usart_rx_callback(), and usart_tx_callback().