X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=protocol%2Flufa%2Flufa.h;h=195123c0f974f55a534ce716769e4358c0129554;hb=ad4cba172b2eea37697ca531016c4c3b4defaeb7;hp=efb8c383781845a56afbd3d6056347a0f71fa0a1;hpb=cc68adeb5744cba9e8650bab04ff0f0a4033db9f;p=max%2Ftmk_keyboard.git diff --git a/protocol/lufa/lufa.h b/protocol/lufa/lufa.h index efb8c383..195123c0 100644 --- a/protocol/lufa/lufa.h +++ b/protocol/lufa/lufa.h @@ -1,3 +1,10 @@ +/* + * Copyright 2012 Jun Wako + * 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 #include #include @@ -41,5 +47,34 @@ #include #include #include +#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