]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - keyboard/lufa/Descriptors.h
initial attempt for LUFA.
[max/tmk_keyboard.git] / keyboard / lufa / Descriptors.h
1 /*\r
2              LUFA Library\r
3      Copyright (C) Dean Camera, 2012.\r
4 \r
5   dean [at] fourwalledcubicle [dot] com\r
6            www.lufa-lib.org\r
7 */\r
8 \r
9 /*\r
10   Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
11   Copyright 2010  Denver Gingerich (denver [at] ossguy [dot] com)\r
12 \r
13   Permission to use, copy, modify, distribute, and sell this\r
14   software and its documentation for any purpose is hereby granted\r
15   without fee, provided that the above copyright notice appear in\r
16   all copies and that both that the copyright notice and this\r
17   permission notice and warranty disclaimer appear in supporting\r
18   documentation, and that the name of the author not be used in\r
19   advertising or publicity pertaining to distribution of the\r
20   software without specific, written prior permission.\r
21 \r
22   The author disclaim all warranties with regard to this\r
23   software, including all implied warranties of merchantability\r
24   and fitness.  In no event shall the author be liable for any\r
25   special, indirect or consequential damages or any damages\r
26   whatsoever resulting from loss of use, data or profits, whether\r
27   in an action of contract, negligence or other tortious action,\r
28   arising out of or in connection with the use or performance of\r
29   this software.\r
30 */\r
31 \r
32 /** \file\r
33  *\r
34  *  Header file for Descriptors.c.\r
35  */\r
36 \r
37 #ifndef _DESCRIPTORS_H_\r
38 #define _DESCRIPTORS_H_\r
39 \r
40         /* Includes: */\r
41                 #include <LUFA/Drivers/USB/USB.h>\r
42 \r
43                 #include <avr/pgmspace.h>\r
44 \r
45         /* Type Defines: */\r
46                 /** Type define for the device configuration descriptor structure. This must be defined in the\r
47                  *  application code, as the configuration descriptor contains several sub-descriptors which\r
48                  *  vary between devices, and which describe the device's usage to the host.\r
49                  */\r
50                 typedef struct\r
51                 {\r
52                         USB_Descriptor_Configuration_Header_t Config;\r
53 \r
54                         // Keyboard HID Interface\r
55                         USB_Descriptor_Interface_t            HID1_KeyboardInterface;\r
56                         USB_HID_Descriptor_HID_t              HID1_KeyboardHID;\r
57                         USB_Descriptor_Endpoint_t             HID1_ReportINEndpoint;\r
58                         USB_Descriptor_Endpoint_t             HID1_ReportOUTEndpoint;\r
59 \r
60                         // Mouse HID Interface\r
61                         USB_Descriptor_Interface_t            HID2_MouseInterface;\r
62                         USB_HID_Descriptor_HID_t              HID2_MouseHID;\r
63                         USB_Descriptor_Endpoint_t             HID2_ReportINEndpoint;\r
64                         USB_Descriptor_Endpoint_t             HID2_ReportOUTEndpoint;\r
65                 } USB_Descriptor_Configuration_t;\r
66 \r
67         /* Macros: */\r
68                 /** Endpoint number of the Keyboard HID reporting IN endpoint. */\r
69                 #define KEYBOARD_IN_EPNUM         1\r
70 \r
71                 /** Endpoint number of the Keyboard HID reporting OUT endpoint. */\r
72                 #define KEYBOARD_OUT_EPNUM        2\r
73 \r
74                 /** Endpoint number of the Mouse HID reporting IN endpoint. */\r
75                 #define MOUSE_IN_EPNUM            3\r
76 \r
77                 /** Size in bytes of each of the HID reporting IN and OUT endpoints. */\r
78                 #define HID_EPSIZE                8\r
79 \r
80         /* Function Prototypes: */\r
81                 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,\r
82                                                     const uint8_t wIndex,\r
83                                                     const void** const DescriptorAddress)\r
84                                                     ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
85 \r
86 #endif\r
87 \r