0.6.1 Improved display code
[digitaldcpower] / uart.h
1 /* vim: set sw=8 ts=8 si et: */
2 /*************************************************************************
3  Title:   C include file for uart
4  Target:    atmega8
5 ***************************************************************************/
6 #ifndef UART_H
7 #define UART_H
8 #include <avr/pgmspace.h>
9
10 extern void uart_init(void);
11 extern void uart_sendchar(char c);
12 extern void uart_sendstr(char *s);
13 extern void uart_sendstr_p(const prog_char *progmem_s);
14 extern char uart_getchar(void);
15 extern unsigned char uart_getchar_noblock(char *returnval);
16 extern void uart_flushRXbuf(void);
17
18 /*
19 ** macros for automatically storing string constant in program memory
20 */
21 #ifndef P
22 #define P(s) ({static const char c[] __attribute__ ((progmem)) = s;c;})
23 #endif
24 #define uart_sendstr_P(__s)         uart_sendstr_p(P(__s))
25
26 #endif /* UART_H */