diff options
| author | tmk <hasu@tmk-kbd.com> | 2015-04-10 01:32:04 +0900 |
|---|---|---|
| committer | tmk <hasu@tmk-kbd.com> | 2015-04-10 01:32:04 +0900 |
| commit | 1a02ebcc612e9a9c0d87e02295c7258de3a70ccc (patch) | |
| tree | e517f3c70bb2d542797e57d13e9023c84af230fb /tmk_core/protocol/lufa/lufa.h | |
| parent | 6746e37088ce8ba03529c1226bd216705edb2b1f (diff) | |
| parent | a074364c3731d66b56d988c8a6c960a83ea0e0a1 (diff) | |
| download | qmk_firmware-1a02ebcc612e9a9c0d87e02295c7258de3a70ccc.tar.gz qmk_firmware-1a02ebcc612e9a9c0d87e02295c7258de3a70ccc.zip | |
Merge commit 'a074364c3731d66b56d988c8a6c960a83ea0e0a1' as 'tmk_core'
Diffstat (limited to 'tmk_core/protocol/lufa/lufa.h')
| -rw-r--r-- | tmk_core/protocol/lufa/lufa.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h new file mode 100644 index 000000000..195123c0f --- /dev/null +++ b/tmk_core/protocol/lufa/lufa.h | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 3 | * This file is based on: | ||
| 4 | * LUFA-120219/Demos/Device/Lowlevel/KeyboardMouse | ||
| 5 | * LUFA-120219/Demos/Device/Lowlevel/GenericHID | ||
| 6 | */ | ||
| 7 | |||
| 8 | /* | ||
| 9 | LUFA Library | ||
| 10 | Copyright (C) Dean Camera, 2012. | ||
| 11 | |||
| 12 | dean [at] fourwalledcubicle [dot] com | ||
| 13 | www.lufa-lib.org | ||
| 14 | */ | ||
| 15 | |||
| 16 | /* | ||
| 17 | Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) | ||
| 18 | Copyright 2010 Denver Gingerich (denver [at] ossguy [dot] com) | ||
| 19 | |||
| 20 | Permission to use, copy, modify, distribute, and sell this | ||
| 21 | software and its documentation for any purpose is hereby granted | ||
| 22 | without fee, provided that the above copyright notice appear in | ||
| 23 | all copies and that both that the copyright notice and this | ||
| 24 | permission notice and warranty disclaimer appear in supporting | ||
| 25 | documentation, and that the name of the author not be used in | ||
| 26 | advertising or publicity pertaining to distribution of the | ||
| 27 | software without specific, written prior permission. | ||
| 28 | |||
| 29 | The author disclaim all warranties with regard to this | ||
| 30 | software, including all implied warranties of merchantability | ||
| 31 | and fitness. In no event shall the author be liable for any | ||
| 32 | special, indirect or consequential damages or any damages | ||
| 33 | whatsoever resulting from loss of use, data or profits, whether | ||
| 34 | in an action of contract, negligence or other tortious action, | ||
| 35 | arising out of or in connection with the use or performance of | ||
| 36 | this software. | ||
| 37 | */ | ||
| 38 | |||
| 39 | #ifndef _LUFA_H_ | ||
| 40 | #define _LUFA_H_ | ||
| 41 | |||
| 42 | #include <avr/io.h> | ||
| 43 | #include <avr/wdt.h> | ||
| 44 | #include <avr/power.h> | ||
| 45 | #include <avr/interrupt.h> | ||
| 46 | #include <stdbool.h> | ||
| 47 | #include <string.h> | ||
| 48 | #include <LUFA/Version.h> | ||
| 49 | #include <LUFA/Drivers/USB/USB.h> | ||
| 50 | #include "host.h" | ||
| 51 | |||
| 52 | |||
| 53 | #ifdef __cplusplus | ||
| 54 | extern "C" { | ||
| 55 | #endif | ||
| 56 | |||
| 57 | extern host_driver_t lufa_driver; | ||
| 58 | |||
| 59 | #ifdef __cplusplus | ||
| 60 | } | ||
| 61 | #endif | ||
| 62 | |||
| 63 | /* extra report structure */ | ||
| 64 | typedef struct { | ||
| 65 | uint8_t report_id; | ||
| 66 | uint16_t usage; | ||
| 67 | } __attribute__ ((packed)) report_extra_t; | ||
| 68 | |||
| 69 | |||
| 70 | #if LUFA_VERSION_INTEGER < 0x120730 | ||
| 71 | /* old API 120219 */ | ||
| 72 | #define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank) Endpoint_ConfigureEndpoint(epnum, eptype, epdir, epsize, epbank) | ||
| 73 | #else | ||
| 74 | /* new API >= 120730 */ | ||
| 75 | #define ENDPOINT_BANK_SINGLE 1 | ||
| 76 | #define ENDPOINT_BANK_DOUBLE 2 | ||
| 77 | #define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank) Endpoint_ConfigureEndpoint((epdir) | (epnum) , eptype, epsize, epbank) | ||
| 78 | #endif | ||
| 79 | |||
| 80 | #endif | ||
