]> git.tdb.fi Git - model-railway-devices.git/blobdiff - common/serial.h
Expand the serial API and add an asynchronous mode
[model-railway-devices.git] / common / serial.h
index 04ea50b198fc502c2d4812ddd370746bc2e6ae93..f5d59876114c29d01876e3cdedd96b4a83184452 100644 (file)
@@ -1,16 +1,13 @@
 #ifndef SERIAL_H_
 #define SERIAL_H_
 
-#include <avr/interrupt.h>
-
-#define SERIAL_SET_CALLBACK(f) \
-       ISR(USART_RX_vect) \
-       { \
-               char c = UDR0; \
-               f(c); \
-       }
+#include <stdint.h>
 
 void serial_init(uint16_t);
+uint8_t serial_read();
+uint8_t serial_read_available();
+uint8_t serial_read_overrun();
 void serial_write(uint8_t);
+uint8_t serial_write_space();
 
 #endif