Configurations for the WILC3000 Serial Bridge Application.
Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
void | configure_usart (uint32_t baudrate) |
Initialize USART module. More... | |
void | usart_stream_move (uint32_t offset) |
Move back USART buffer. More... | |
int | usart_stream_read (uint8_t **data, uint32_t *size) |
Read data from USART module. More... | |
void | usart_stream_reset (void) |
Clear USART buffer and flush USART module. More... | |
void | usart_stream_write (uint8_t data) |
Write one byte of data. More... | |
void | usart_stream_write_buffer (uint8_t *data, uint32_t size) |
Write multiple bytes of data. More... | |
Variables | |
static uint8_t | usart_buffer [USART_BUFFER_MAX] |
static uint32_t | usart_recv_size = 0 |
void configure_usart | ( | uint32_t | baud_rate | ) |
Initialize USART module.
baud_rate | Baudrate of USART. |
References uart_rs232_options::baudrate, CONF_STDIO_PARITY, CONF_STDIO_USART_MODULE, usart_serial_init(), and usart_stream_reset().
Referenced by main(), and usart_reconfigure_handler().
void usart_stream_move | ( | uint32_t | offset | ) |
Move back USART buffer.
offset | Size of data to remove. |
References usart_buffer, and usart_recv_size.
Referenced by usart_read_block_handler(), usart_read_reg_with_ret_handler(), usart_reconfigure_handler(), usart_sync_cmd_handler(), usart_write_block_handler(), and usart_write_reg_handler().
int usart_stream_read | ( | uint8_t ** | data, |
uint32_t * | size | ||
) |
Read data from USART module.
data | Pointer to USART buffer. |
data | Pointer to USART buffer size. |
References uart_read(), usart_buffer, usart_read(), and usart_recv_size.
Referenced by serial_bridge(), and usart_write_block_handler().
Clear USART buffer and flush USART module.
References CONF_STDIO_USART_MODULE, uart_enable(), uart_reset(), usart_enable_rx(), usart_recv_size, and usart_reset_rx().
Referenced by bt_hci_reset_handler(), bt_hci_start_rx_handler(), bt_hci_start_tx_handler(), bt_hci_stop_txrx_handler(), configure_usart(), serial_bridge(), and usart_frame_parse().
void usart_stream_write | ( | uint8_t | data | ) |
Write one byte of data.
data | Data to send. |
References CONF_STDIO_USART_MODULE, uart_is_tx_buf_empty(), usart_is_tx_empty(), and usart_serial_putchar().
Referenced by usart_frame_parse(), usart_read_block_handler(), usart_read_reg_with_ret_handler(), usart_reconfigure_handler(), usart_sync_cmd_handler(), usart_write_block_handler(), and usart_write_reg_handler().
void usart_stream_write_buffer | ( | uint8_t * | data, |
uint32_t | size | ||
) |
Write multiple bytes of data.
data | Pointer to data to send. |
size | Size of data. |
References usart_serial_putchar().
Referenced by USART1_Handler(), usart_read_block_handler(), usart_read_reg_with_ret_handler(), usart_write_block_handler(), and usart_write_reg_handler().
|
static |
Referenced by usart_stream_move(), and usart_stream_read().
|
static |
Referenced by usart_stream_move(), usart_stream_read(), and usart_stream_reset().