SAM D21 UART API Implementations.
Copyright (c) 2019 Microchip Technology Inc. and its subsidiaries.
Functions | |
uint8_t | buffered_uart_getchar (void) |
This function performs a blocking character receive functionality. More... | |
int | buffered_uart_getchar_nowait (void) |
This function performs a non-blocking character receive functionality. More... | |
void | buffered_uart_init (uint32_t baudrate) |
Initializes the Buffered Serial IO Module. More... | |
void | buffered_uart_putchar (uint8_t ch) |
This function prints the character to the host. More... | |
uint8_t | buffered_uart_rx (uint8_t *data, uint8_t max_len) |
Receives data from UART. More... | |
void | buffered_uart_term (void) |
Terminate the Buffered Serial IO Module. More... | |
uint8_t | buffered_uart_tx (uint8_t *data, uint32_t length) |
Transmits data via UART. More... | |
void | USART_HOST_ISR_VECT (void) |
Variables | |
static struct usart_module | host_uart_module |
static uint8_t | serial_rx_buf [SERIAL_RX_BUF_SIZE_HOST] |
static uint8_t | serial_rx_buf_head |
static uint8_t | serial_rx_buf_tail |
uint8_t buffered_uart_getchar | ( | void | ) |
This function performs a blocking character receive functionality.
References buffered_uart_getchar_nowait().
int buffered_uart_getchar_nowait | ( | void | ) |
This function performs a non-blocking character receive functionality.
References cpu_irq_disable, cpu_irq_enable, serial_rx_buf, serial_rx_buf_head, SERIAL_RX_BUF_SIZE_HOST, and serial_rx_buf_tail.
Referenced by buffered_uart_getchar().
void buffered_uart_init | ( | uint32_t | baudrate | ) |
Initializes the Buffered Serial IO Module.
References usart_config::baudrate, HOST_SERCOM_MUX_SETTING, HOST_SERCOM_PINMUX_PAD0, HOST_SERCOM_PINMUX_PAD1, HOST_SERCOM_PINMUX_PAD2, HOST_SERCOM_PINMUX_PAD3, host_uart_module, usart_config::mux_setting, usart_config::pinmux_pad0, usart_config::pinmux_pad1, usart_config::pinmux_pad2, usart_config::pinmux_pad3, serial_rx_buf_head, serial_rx_buf_tail, usart_enable(), usart_get_config_defaults(), USART_HOST, and USART_HOST_RX_ISR_ENABLE.
Referenced by main(), and serial_bridge_process_reconfigure().
void buffered_uart_putchar | ( | uint8_t | ) |
This function prints the character to the host.
References USART_HOST.
Referenced by buffered_uart_tx(), serial_bridge_process_frame(), serial_bridge_process_read_block(), serial_bridge_process_read_reg_with_ret(), serial_bridge_process_reconfigure(), serial_bridge_process_sync_cmd(), serial_bridge_process_write_block(), and serial_bridge_process_write_reg().
uint8_t buffered_uart_rx | ( | uint8_t * | data, |
uint8_t | max_length | ||
) |
Receives data from UART.
data | pointer to the buffer where the received data is to be stored |
max_length | maximum length of data to be received |
References cpu_irq_disable, cpu_irq_enable, serial_rx_buf, serial_rx_buf_head, SERIAL_RX_BUF_SIZE_HOST, and serial_rx_buf_tail.
Referenced by enter_wifi_firmware_download(), and serial_bridge_frame_receive().
void buffered_uart_term | ( | void | ) |
Terminate the Buffered Serial IO Module.
References host_uart_module, and usart_disable().
Referenced by serial_bridge_process_reconfigure().
uint8_t buffered_uart_tx | ( | uint8_t * | data, |
uint32_t | length | ||
) |
Transmits data via UART.
data | Pointer to the buffer where the data to be transmitted is present |
length | Number of bytes to be transmitted |
References buffered_uart_putchar(), and STATUS_OK.
Referenced by serial_bridge_process_read_block().
void USART_HOST_ISR_VECT | ( | void | ) |
References serial_rx_buf, SERIAL_RX_BUF_SIZE_HOST, serial_rx_buf_tail, and USART_HOST.
|
static |
Referenced by buffered_uart_init(), and buffered_uart_term().
|
static |
Referenced by buffered_uart_getchar_nowait(), buffered_uart_rx(), and USART_HOST_ISR_VECT().
|
static |
Referenced by buffered_uart_getchar_nowait(), buffered_uart_init(), and buffered_uart_rx().
|
static |
Referenced by buffered_uart_getchar_nowait(), buffered_uart_init(), buffered_uart_rx(), and USART_HOST_ISR_VECT().