0.6.1 Improved display code
[digitaldcpower] / uart.h
diff --git a/uart.h b/uart.h
new file mode 100644 (file)
index 0000000..bd69475
--- /dev/null
+++ b/uart.h
@@ -0,0 +1,26 @@
+/* vim: set sw=8 ts=8 si et: */
+/*************************************************************************
+ Title:   C include file for uart
+ Target:    atmega8
+***************************************************************************/
+#ifndef UART_H
+#define UART_H
+#include <avr/pgmspace.h>
+
+extern void uart_init(void);
+extern void uart_sendchar(char c);
+extern void uart_sendstr(char *s);
+extern void uart_sendstr_p(const prog_char *progmem_s);
+extern char uart_getchar(void);
+extern unsigned char uart_getchar_noblock(char *returnval);
+extern void uart_flushRXbuf(void);
+
+/*
+** macros for automatically storing string constant in program memory
+*/
+#ifndef P
+#define P(s) ({static const char c[] __attribute__ ((progmem)) = s;c;})
+#endif
+#define uart_sendstr_P(__s)         uart_sendstr_p(P(__s))
+
+#endif /* UART_H */