Microchip® Advanced Software Framework

serial_bridge_wilc1000_example/uart_stream.h File Reference

Configurations for the WILC1000 Serial Bridge Application.

Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.

#include <inttypes.h>
#include <asf.h>

Macros

#define USART_BUFFER_MAX   (2 * 1024)
 

Functions

void configure_usart (uint32_t baud_rate)
 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...
 

#define USART_BUFFER_MAX   (2 * 1024)

void configure_usart ( uint32_t  baud_rate)

Initialize USART module.

Parameters
baud_rateBaudrate of USART.

References uart_rs232_options::baudrate, CONF_UART, CONF_UART_PARITY, usart_serial_init(), and usart_stream_reset().

void usart_stream_move ( uint32_t  offset)
int usart_stream_read ( uint8_t **  data,
uint32_t *  size 
)

Read data from USART module.

Parameters
dataPointer to USART buffer.
dataPointer to USART buffer size.

References uart_read(), usart_buffer, usart_read(), and usart_recv_size.

Referenced by enter_wifi_firmware_download(), serial_bridge(), and usart_write_block_handler().

void usart_stream_write_buffer ( uint8_t *  data,
uint32_t  size 
)

Write multiple bytes of data.

Parameters
dataPointer to data to send.
sizeSize 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().