41 #ifndef COMPILER_AVR_H
42 #include "avr_compiler.h"
45 #ifndef USART_DRIVER_H
46 #include "usart_driver.h"
52 #define UART_NO_DATA 0x0100
54 uint16_t
calc_bsel(uint32_t f_cpu, uint32_t baud, int8_t scale, uint8_t clk2x);
56 void uart_putc(USART_data_t *uart, uint8_t data);
57 void uart_puts(USART_data_t *uart,
char *s);
59 void init_uart(USART_data_t *uart, USART_t *usart, uint32_t f_cpu, uint32_t baud, uint8_t clk2x);
61 uint32_t f_cpu, uint32_t baud, uint8_t clk2x,
62 USART_RXCINTLVL_t rxcIntLevel, USART_DREINTLVL_t dreIntLevel);
77 USART_RXComplete(&
uartC0.usart);
86 USART_DataRegEmpty(&
uartC0.usart);
105 USART_RXComplete(&
uartC1);
114 USART_DataRegEmpty(&
uartC1);
132 USART_RXComplete(&
uartD0);
141 USART_DataRegEmpty(&
uartD0);
159 USART_RXComplete(&
uartD1);
168 USART_DataRegEmpty(&
uartD1);
186 USART_RXComplete(&
uartE0);
195 USART_DataRegEmpty(&
uartE0);
213 USART_RXComplete(&
uartE1);
222 USART_DataRegEmpty(&
uartE1);
240 USART_RXComplete(&
uartF0);
249 USART_DataRegEmpty(&
uartF0);
267 USART_RXComplete(&
uartF1);
276 USART_DataRegEmpty(&
uartF1);
USART_data_t uartF0
Global declaration uart with databuffers for UARTF0. This variable is only defined if the macro ENABL...
Definition: uart.h:232
USART_data_t uartE1
Global declaration uart with databuffers for UARTE1. This variable is only defined if the macro ENABL...
Definition: uart.h:205
USART_data_t uartF1
Global declaration uart with databuffers for UARTF1. This variable is only defined if the macro ENABL...
Definition: uart.h:259
ISR(USARTC0_RXC_vect)
Interrupt Service Routine for receiving with UARTC0. This ISR is only defined if the macro ENABLE_UAR...
Definition: uart.h:75
uint16_t uart_getc(USART_data_t *uart)
Get a byte from the circular receive buffer.
Definition: uart.c:51
void init_uart(USART_data_t *uart, USART_t *usart, uint32_t f_cpu, uint32_t baud, uint8_t clk2x)
Initializes the UART.
Definition: uart.c:233
void init_uart_levels(USART_data_t *uart, USART_t *usart, uint32_t f_cpu, uint32_t baud, uint8_t clk2x, USART_RXCINTLVL_t rxcIntLevel, USART_DREINTLVL_t dreIntLevel)
Initializes the UART.
Definition: uart.c:269
USART_data_t uartC1
Global declaration uart with databuffers for UARTC1. This variable is only defined if the macro ENABL...
Definition: uart.h:97
USART_data_t uartD0
Global declaration uart with databuffers for UARTD0. This variable is only defined if the macro ENABL...
Definition: uart.h:124
USART_data_t uartE0
Global declaration uart with databuffers for UARTE0. This variable is only defined if the macro ENABL...
Definition: uart.h:178
void uart_putc(USART_data_t *uart, uint8_t data)
Write a byte to the circular transmit buffer.
Definition: uart.c:71
uint16_t calc_bsel(uint32_t f_cpu, uint32_t baud, int8_t scale, uint8_t clk2x)
Calculates the baud rate value BSEL.
Definition: uart.c:182
USART_data_t uartD1
Global declaration uart with databuffers for UARTD1. This variable is only defined if the macro ENABL...
Definition: uart.h:151
USART_data_t uartC0
Global declaration uart with databuffers for UARTC0. This variable is only defined if the macro ENABL...
Definition: uart.h:69
void set_usart_txrx_direction(USART_t *usart)
Set direction for the transmit and receive pin.
Definition: uart.c:100
void uart_puts(USART_data_t *uart, char *s)
Write a string to the circulair transmit buffer.
Definition: uart.c:85