summaryrefslogtreecommitdiffstats
path: root/kbd.h
diff options
context:
space:
mode:
Diffstat (limited to 'kbd.h')
-rw-r--r--kbd.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/kbd.h b/kbd.h
new file mode 100644
index 0000000..7ad3a21
--- /dev/null
+++ b/kbd.h
@@ -0,0 +1,25 @@
+#ifndef _AVR_KBD_H_
+#define _AVR_KBD_H_
+
+#include <avr/io.h>
+#include <stdint.h>
+#include <stdbool.h>
+
+#define KBD_FLAG_ERROR (_BV(0))
+#define KBD_FLAG_BREAK (_BV(1))
+#define KBD_FLAG_EXT (_BV(2))
+
+#define KBD_CODE_UP 0xe075
+#define KBD_CODE_LEFT 0xe06b
+#define KBD_CODE_DOWN 0xe072
+#define KBD_CODE_RIGHT 0xe074
+
+#define KBD_CMD_RESET 0xff
+
+
+void kbd_handle(uint16_t code, bool make);
+
+void kbd_send(uint8_t command);
+void kbd_init(void);
+
+#endif /* _AVR_KBD_H_ */