]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - tmk_core/protocol/xt_io.h
xt_usb: Replace functions with macros
[max/tmk_keyboard.git] / tmk_core / protocol / xt_io.h
index 4198e6557f7b9c4f0d63805d1705bd1c1157783d..8252e1cf78138a2e65eb0496cbfa0430f5274771 100644 (file)
@@ -1,10 +1,29 @@
 #ifndef XT_IO_H
 #define XT_IO_H
 
-bool clock_in(void);
-bool data_in(void);
+#define XT_DATA_IN()        do { \
+    XT_DATA_DDR  &= ~(1<<XT_DATA_BIT); \
+    XT_DATA_PORT |=  (1<<XT_DATA_BIT); \
+} while (0)
 
-void clock_lo(void);
-void data_lo(void);
+#define XT_DATA_READ()      (XT_DATA_PIN&(1<<XT_DATA_BIT))
+
+#define XT_DATA_LO()        do { \
+    XT_DATA_PORT &= ~(1<<XT_DATA_BIT); \
+    XT_DATA_DDR  |=  (1<<XT_DATA_BIT); \
+} while (0)
+
+
+#define XT_CLOCK_IN()       do { \
+    XT_CLOCK_DDR  &= ~(1<<XT_CLOCK_BIT); \
+    XT_CLOCK_PORT |=  (1<<XT_CLOCK_BIT); \
+} while (0)
+
+#define XT_CLOCK_READ()     (XT_CLOCK_PIN&(1<<XT_CLOCK_BIT))
+
+#define XT_CLOCK_LO()       do { \
+    XT_CLOCK_PORT &= ~(1<<XT_CLOCK_BIT); \
+    XT_CLOCK_DDR  |=  (1<<XT_CLOCK_BIT); \
+} while (0)
 
 #endif