]> git.donarmstrong.com Git - tmk_firmware.git/blobdiff - protocol/lufa/lufa.h
Add flow control by firmware to serial_uart
[tmk_firmware.git] / protocol / lufa / lufa.h
index 71c279b0dcb27570e810a3e91dd1c2ae31dea504..195123c0f974f55a534ce716769e4358c0129554 100644 (file)
 #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