summaryrefslogtreecommitdiff
path: root/keyboard/mbed_onekey/HIDKeyboard.h
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2014-06-15 13:56:17 +0900
committertmk <nobody@nowhere>2014-07-30 14:07:43 +0900
commitf15b2691c92e1d9b3c0e59363c803ec540303f37 (patch)
treee875f43e4726de490c90ec408b3a41f781762904 /keyboard/mbed_onekey/HIDKeyboard.h
parent79840c678e13f9a737f80048bc3b9c9c55e3fc77 (diff)
Add keyboard/mbed_onekey
Diffstat (limited to 'keyboard/mbed_onekey/HIDKeyboard.h')
-rw-r--r--keyboard/mbed_onekey/HIDKeyboard.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/keyboard/mbed_onekey/HIDKeyboard.h b/keyboard/mbed_onekey/HIDKeyboard.h
new file mode 100644
index 0000000000..b00c97b9b0
--- /dev/null
+++ b/keyboard/mbed_onekey/HIDKeyboard.h
@@ -0,0 +1,36 @@
+#ifndef HIDKEYBOARD_H
+
+#include "stdint.h"
+#include "stdbool.h"
+#include "USBHID.h"
+
+
+typedef union {
+ uint8_t raw[8];
+ struct {
+ uint8_t mods;
+ uint8_t reserved;
+ uint8_t keys[6];
+ };
+} __attribute__ ((packed)) report_keyboard_t;
+
+
+class HIDKeyboard : public USBDevice {
+public:
+ HIDKeyboard(uint16_t vendor_id = 0xFEED, uint16_t product_id = 0xabed, uint16_t product_release = 0x0001);
+
+ bool sendReport(report_keyboard_t report);
+protected:
+ uint16_t reportLength;
+ virtual bool USBCallback_setConfiguration(uint8_t configuration);
+ virtual uint8_t * stringImanufacturerDesc();
+ virtual uint8_t * stringIproductDesc();
+ virtual uint8_t * stringIserialDesc();
+ virtual uint16_t reportDescLength();
+ virtual uint8_t * reportDesc();
+ virtual uint8_t * configurationDesc();
+ //virtual uint8_t * deviceDesc();
+ virtual bool USBCallback_request();
+};
+
+#endif