1 /* vim: set sw=8 ts=8 si et: */
2 /*************************************************************************
3 Title: C include file for uart
5 Copyright: GPL, Guido Socher
6 ***************************************************************************/
9 #include <avr/pgmspace.h>
11 extern void uart_init(void);
12 extern void uart_poll_getchar_isr(void); // call this periodically from interrupt, has a buffer bigger than one char
13 extern unsigned char uart_getchar_isr_noblock(char *returnval); // get a char from buffer if available
14 extern void uart_sendchar(char c); // blocking, no buffer
15 extern void uart_sendstr(char *s); // blocking, no buffer
16 extern void uart_sendstr_p(const prog_char *progmem_s); // blocking, no buffer
18 // you can either use the above _isr functions or one of the
19 // following two but you can not mix them.
20 extern char uart_getchar(void);
21 extern unsigned char uart_getchar_noblock(char *returnval);
22 extern void uart_flushRXbuf(void);
26 ** macros for automatically storing string constant in program memory
29 #define P(s) ({static const char c[] __attribute__ ((progmem)) = s;c;})
31 #define uart_sendstr_P(__s) uart_sendstr_p(P(__s))