00001 00013 #ifndef UART_H 00014 #define UART_H 00015 00016 #include <avr/io.h> 00017 #include <inttypes.h> 00018 00019 #ifndef BAUD 00020 00022 #define BAUD 9600 00023 #warning "choosing 9600 baud as default" 00024 #endif 00025 00026 #ifdef UART_X2 00027 00028 #define BAUD_SETTING (F_CPU/(8UL*BAUD)-1) 00029 #else 00030 00031 #define BAUD_SETTING (F_CPU/(16UL*BAUD)-1) 00032 #endif 00033 00044 inline void uart_init( uint16_t brr ); 00045 00055 int uart_putchar( char c ); 00056 00067 char uart_getchar( char *c ); 00068 00077 int uart_puts( const char* s ); 00078 00079 #endif