Interrupt UART library using the built-in UART with transmit and receive circular buffers.
More...
Interrupt UART library using the built-in UART with transmit and receive circular buffers.
This library can be used to transmit and receive data through the built in UART.
An interrupt is generated when the UART has finished transmitting or receiving a byte. The interrupt handling routines use circular buffers for buffering received and transmitted data.
The UART_RX_BUFFER_SIZE and UART_TX_BUFFER_SIZE constants define the size of the circular buffers in bytes. Note that these constants must be a power of 2. You may need to adapt this size to your target and your application.
- Note
- Based on Atmel Application Note AVR306
- Author
- Peter Fleury pfleu.nosp@m.ry@g.nosp@m.mx.ch http://jump.to/fleury
#define P |
( |
|
s | ) |
({static const char c[] __attribute__ ((progmem)) = s;c;}) |
#define UART_BAUD_SELECT |
( |
|
baudRate, |
|
|
|
xtalCpu |
|
) |
| ((xtalCpu + baudRate * 8L) / (baudRate * 16L) - 1) |
UART Baudrate Expression.
- Parameters
-
xtalcpu | system clock in Mhz |
baudrate | baudrate in bps, e.g. 1200, 2400, 9600 |
#define UART_BUFFER_OVERFLOW 0x0200 /* receive ringbuffer overflow */ |
#define UART_FRAME_ERROR 0x0800 /* Framing Error by UART */ |
#define uart_init |
( |
|
baud | ) |
do {} while(0) |
#define UART_NO_DATA 0x0100 /* no receive data available */ |
#define UART_OVERRUN_ERROR 0x0400 /* Overrun condition by UART */ |
#define uart_poll |
( |
| ) |
do {} while(0) |
#define uart_puthex_byte |
( |
|
b | ) |
do {} while(0) |
#define uart_puthex_byte_ |
( |
|
b | ) |
do {} while(0) |
#define uart_puthex_nibble |
( |
|
b | ) |
do {} while(0) |
#define uart_puthex_word |
( |
|
b | ) |
do {} while(0) |
#define uart_puti |
( |
|
i | ) |
do {} while(0) |
#define uart_putl |
( |
|
i | ) |
do {} while(0) |
#define uart_puts |
( |
|
s | ) |
do {} while(0) |
#define uart_puts_p |
( |
|
s | ) |
do {} while(0) |
#define uart_puts_P |
( |
|
s | ) |
do {} while(0) |