summaryrefslogtreecommitdiff
path: root/firmware/src/keyboard.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/src/keyboard.h')
-rw-r--r--firmware/src/keyboard.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/firmware/src/keyboard.h b/firmware/src/keyboard.h
new file mode 100644
index 0000000..3f492e9
--- /dev/null
+++ b/firmware/src/keyboard.h
@@ -0,0 +1,44 @@
+/*
+ * File: keyboard.h
+ * Author: Camil Staps <info@camilstaps.nl>
+ *
+ * Created on August 30, 2015, 11:29 AM
+ */
+
+#ifndef KEYBOARD_H
+#define KEYBOARD_H
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include "usb/usb_hid.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+bool keyboard_init();
+void keyboard_setKeyHandler(void(*keyHandler)(USB_HID_KEYBOARD_KEYPAD));
+void keyboard_handleKeys(void);
+
+void BSP_USBVBUSPowerEnable(uint8_t port, bool enable);
+bool BSP_USBVBUSSwitchOverCurrentDetect(uint8_t port);
+
+const static char *keyboard_keyValue[] = {
+ "No event indicated", "ErrorRoll Over", "POSTFail", "Error Undefined",
+ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
+ "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
+ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0",
+ "ENTER", "ESCAPE", "BACKSPACE", "TAB", "SPACEBAR",
+ "-", "=", "[", "]", "\\0", "~", ";", "'", "GRAVE ACCENT", ",", ".", "/",
+ "CAPS LOCK",
+ "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* KEYBOARD_H */
+