]> git.tdb.fi Git - model-railway-devices.git/blobdiff - common/serial.h
Reorganize the directory structure
[model-railway-devices.git] / common / serial.h
diff --git a/common/serial.h b/common/serial.h
new file mode 100644 (file)
index 0000000..04ea50b
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef SERIAL_H_
+#define SERIAL_H_
+
+#include <avr/interrupt.h>
+
+#define SERIAL_SET_CALLBACK(f) \
+       ISR(USART_RX_vect) \
+       { \
+               char c = UDR0; \
+               f(c); \
+       }
+
+void serial_init(uint16_t);
+void serial_write(uint8_t);
+
+#endif