]> git.donarmstrong.com Git - tmk_firmware.git/blob - protocol/lufa/lufa.h
Updates to local gitignore
[tmk_firmware.git] / protocol / lufa / lufa.h
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