USART example 2 application for AVR UC3 USART driver.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
int | main (void) |
Application main loop. More... | |
Variables | |
static const usart_options_t | usart_opt |
USART configuration options. More... | |
int main | ( | void | ) |
Application main loop.
Enable the clock to the selected example USART peripheral module. The clocks to all non-essential peripherals are disabled in the conf_clock.h file, so we need to re-enable our USART clock here.
Write the example USART module configuration to the hardware registers. The example USART is selected in the conf_example_usart.h file.
Write a welcome message on the USART and busy-wait for the listener to press the enter key.
Busy-wait for a carriage return sent from the listener. Any received characters are echoed back.
Send a goodbye message before entering a forever non-return loop.
References board_init(), EXAMPLE_USART, sysclk_enable_peripheral_clock(), sysclk_get_peripheral_bus_hz(), sysclk_init(), USART_FAILURE, usart_get_echo_line(), usart_init_rs232(), and usart_write_line().
|
static |
USART configuration options.
This struct contains the configuration options for the USART module in use by the example application.