]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - protocol/lufa/lufa.h
Move macro definitions from lufa.c to lufa.h
[max/tmk_keyboard.git] / protocol / lufa / lufa.h
index efb8c383781845a56afbd3d6056347a0f71fa0a1..195123c0f974f55a534ce716769e4358c0129554 100644 (file)
@@ -1,3 +1,10 @@
+/* 
+ * Copyright 2012 Jun Wako <wakojun@gmail.com>
+ * This file is based on:
+ *     LUFA-120219/Demos/Device/Lowlevel/KeyboardMouse
+ *     LUFA-120219/Demos/Device/Lowlevel/GenericHID
+ */
+
 /*
              LUFA Library
      Copyright (C) Dean Camera, 2012.
@@ -32,7 +39,6 @@
 #ifndef _LUFA_H_
 #define _LUFA_H_
 
-       /* Includes: */
 #include <avr/io.h>
 #include <avr/wdt.h>
 #include <avr/power.h>
 #include <string.h>
 #include <LUFA/Version.h>
 #include <LUFA/Drivers/USB/USB.h>
+#include "host.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern host_driver_t lufa_driver;
+
+#ifdef __cplusplus
+}
+#endif
+
+/* extra report structure */
+typedef struct {
+    uint8_t  report_id;
+    uint16_t usage;
+} __attribute__ ((packed)) report_extra_t;
+
+
+#if LUFA_VERSION_INTEGER < 0x120730
+    /* old API 120219 */
+    #define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank)    Endpoint_ConfigureEndpoint(epnum, eptype, epdir, epsize, epbank)
+#else
+    /* new API >= 120730 */
+    #define ENDPOINT_BANK_SINGLE 1
+    #define ENDPOINT_BANK_DOUBLE 2
+    #define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank)    Endpoint_ConfigureEndpoint((epdir) | (epnum) , eptype, epsize, epbank)
+#endif
 
 #endif