Break device mode class driver interfaces into seperate config and state structs...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Common / HID.h
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2009.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
7 */
8
9 /*
10 Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, and distribute this software
13 and its documentation for any purpose and without fee is hereby
14 granted, provided that the above copyright notice appear in all
15 copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
31 /** \ingroup Group_USBClassHID
32 * @{
33 */
34
35 #ifndef _HID_CLASS_COMMON_H_
36 #define _HID_CLASS_COMMON_H_
37
38 /* Includes: */
39 #include "../../USB.h"
40
41 #include <string.h>
42
43 /* Macros: */
44 /** HID Class Specific Request to get the current HID report from the device. */
45 #define REQ_GetReport 0x01
46
47 /** HID Class Specific Request to get the current device idle count. */
48 #define REQ_GetIdle 0x02
49
50 /** HID Class Specific Request to set the current HID report to the device. */
51 #define REQ_SetReport 0x09
52
53 /** HID Class Specific Request to set the device's idle count. */
54 #define REQ_SetIdle 0x0A
55
56 /** HID Class Specific Request to get the current HID report protocol mode. */
57 #define REQ_GetProtocol 0x03
58
59 /** HID Class Specific Request to set the current HID report protocol mode. */
60 #define REQ_SetProtocol 0x0B
61
62 /** Descriptor header type value, to indicate a HID class HID descriptor. */
63 #define DTYPE_HID 0x21
64
65 /** Descriptor header type value, to indicate a HID class HID report descriptor. */
66 #define DTYPE_Report 0x22
67
68 /* Type Defines: */
69 /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
70 * specification for details on the structure elements.
71 */
72 typedef struct
73 {
74 USB_Descriptor_Header_t Header;
75
76 uint16_t HIDSpec;
77 uint8_t CountryCode;
78
79 uint8_t TotalReportDescriptors;
80
81 uint8_t HIDReportType;
82 uint16_t HIDReportLength;
83 } USB_Descriptor_HID_t;
84
85 /** Type define for the data type used to store HID report descriptor elements. */
86 typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
87
88 #endif
89
90 /** @} */