uart  1.4
Serial stream for Xmega/Wrapper for UART-driver Xmega
 All Files Functions Variables Macros
wrapper_test.c File Reference

Example for wrapper (uart.c and uart.h). More...

#include <avr/io.h>
#include <avr/interrupt.h>
#include "uart.h"

Macros

#define F_CPU   2000000UL
 system clock frequency
 
#define ENABLE_UART_C1   1
 Macro ENABLE_UART_C1 non zero, in order to ensure that UART C1 is used.
 
#define C1_BAUD   115200
 baud rate
 
#define C1_CLK2X   0
 no double clock speed
 

Functions

int main (void)
 main routine example More...
 

Detailed Description

Example for wrapper (uart.c and uart.h).

Author
Wim Dolman (w.e.dolman@hva.nl)
Date
29-11-2013
Version
1.1

This example using the wrapper (uart.c and uart.h) for the UART-driver from Atmel's application note AVR1307 (usart_driver.c and usart_driver.h) which uses avr_compiler.h.

This example uses the wrapper to receive a byte and to send this byte back in a formatted text string.

Note
With the internal RC-oscillators 2 MHz or 32 MHz, it can be necessary to calibrate this internal clock.

Function Documentation

int main ( void  )

main routine example

It initializes the USARTC1 and receive characters from the UART and sends the characters back in a formatted text string.

Returns
int