3 Copyright (C) Dean Camera, 2011.
5 dean [at] fourwalledcubicle [dot] com
10 Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all 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.
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
32 * \brief Common definitions and declarations for the library USB HID Class driver.
34 * Common definitions and declarations for the library USB HID Class driver.
36 * \note This file should not be included directly. It is automatically included as needed by the USB module driver
37 * dispatch header located in LUFA/Drivers/USB.h.
40 /** \ingroup Group_USBClassHID
41 * @defgroup Group_USBClassHIDCommon Common Class Definitions
43 * \section Sec_ModDescription Module Description
44 * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB
50 #ifndef _HID_CLASS_COMMON_H_
51 #define _HID_CLASS_COMMON_H_
54 #include "../../HighLevel/StdDescriptors.h"
55 #include "HIDParser.h"
59 /* Preprocessor Checks: */
60 #if !defined(__INCLUDE_FROM_HID_DRIVER)
61 #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
65 /** \name Keyboard Standard Report Modifier Masks */
67 /** Constant for a keyboard report modifier byte, indicating that the keyboard's left control key is currently pressed. */
68 #define HID_KEYBOARD_MODIFER_LEFTCTRL (1 << 0)
70 /** Constant for a keyboard report modifier byte, indicating that the keyboard's left shift key is currently pressed. */
71 #define HID_KEYBOARD_MODIFER_LEFTSHIFT (1 << 1)
73 /** Constant for a keyboard report modifier byte, indicating that the keyboard's left alt key is currently pressed. */
74 #define HID_KEYBOARD_MODIFER_LEFTALT (1 << 2)
76 /** Constant for a keyboard report modifier byte, indicating that the keyboard's left GUI key is currently pressed. */
77 #define HID_KEYBOARD_MODIFER_LEFTGUI (1 << 3)
79 /** Constant for a keyboard report modifier byte, indicating that the keyboard's right control key is currently pressed. */
80 #define HID_KEYBOARD_MODIFER_RIGHTCTRL (1 << 4)
82 /** Constant for a keyboard report modifier byte, indicating that the keyboard's right shift key is currently pressed. */
83 #define HID_KEYBOARD_MODIFER_RIGHTSHIFT (1 << 5)
85 /** Constant for a keyboard report modifier byte, indicating that the keyboard's right alt key is currently pressed. */
86 #define HID_KEYBOARD_MODIFER_RIGHTALT (1 << 6)
88 /** Constant for a keyboard report modifier byte, indicating that the keyboard's right GUI key is currently pressed. */
89 #define HID_KEYBOARD_MODIFER_RIGHTGUI (1 << 7)
92 /** \name Keyboard Standard Report LED Masks */
94 /** Constant for a keyboard output report LED byte, indicating that the host's NUM LOCK mode is currently set. */
95 #define HID_KEYBOARD_LED_NUMLOCK (1 << 0)
97 /** Constant for a keyboard output report LED byte, indicating that the host's CAPS LOCK mode is currently set. */
98 #define HID_KEYBOARD_LED_CAPSLOCK (1 << 1)
100 /** Constant for a keyboard output report LED byte, indicating that the host's SCROLL LOCK mode is currently set. */
101 #define HID_KEYBOARD_LED_SCROLLLOCK (1 << 2)
103 /** Constant for a keyboard output report LED byte, indicating that the host's KATANA mode is currently set. */
104 #define HID_KEYBOARD_LED_KATANA (1 << 3)
107 /** \name Keyboard Standard Report Key Scancodes */
109 #define HID_KEYBOARD_SC_ERROR_ROLLOVER 0x01
110 #define HID_KEYBOARD_SC_POST_FAIL 0x02
111 #define HID_KEYBOARD_SC_ERROR_UNDEFINED 0x03
112 #define HID_KEYBOARD_SC_A 0x04
113 #define HID_KEYBOARD_SC_B 0x05
114 #define HID_KEYBOARD_SC_C 0x06
115 #define HID_KEYBOARD_SC_D 0x07
116 #define HID_KEYBOARD_SC_E 0x08
117 #define HID_KEYBOARD_SC_F 0x09
118 #define HID_KEYBOARD_SC_G 0x0A
119 #define HID_KEYBOARD_SC_H 0x0B
120 #define HID_KEYBOARD_SC_I 0x0C
121 #define HID_KEYBOARD_SC_J 0x0D
122 #define HID_KEYBOARD_SC_K 0x0E
123 #define HID_KEYBOARD_SC_L 0x0F
124 #define HID_KEYBOARD_SC_M 0x10
125 #define HID_KEYBOARD_SC_N 0x11
126 #define HID_KEYBOARD_SC_O 0x12
127 #define HID_KEYBOARD_SC_P 0x13
128 #define HID_KEYBOARD_SC_Q 0x14
129 #define HID_KEYBOARD_SC_R 0x15
130 #define HID_KEYBOARD_SC_S 0x16
131 #define HID_KEYBOARD_SC_T 0x17
132 #define HID_KEYBOARD_SC_U 0x18
133 #define HID_KEYBOARD_SC_V 0x19
134 #define HID_KEYBOARD_SC_W 0x1A
135 #define HID_KEYBOARD_SC_X 0x1B
136 #define HID_KEYBOARD_SC_Y 0x1C
137 #define HID_KEYBOARD_SC_Z 0x1D
138 #define HID_KEYBOARD_SC_1_AND_EXCLAMATION 0x1E
139 #define HID_KEYBOARD_SC_2_AND_AT 0x1F
140 #define HID_KEYBOARD_SC_3_AND_HASHMARK 0x20
141 #define HID_KEYBOARD_SC_4_AND_DOLLAR 0x21
142 #define HID_KEYBOARD_SC_5_AND_PERCENTAGE 0x22
143 #define HID_KEYBOARD_SC_6_AND_CARET 0x23
144 #define HID_KEYBOARD_SC_7_AND_AND_AMPERSAND 0x24
145 #define HID_KEYBOARD_SC_8_AND_ASTERISK 0x25
146 #define HID_KEYBOARD_SC_9_AND_OPENING_PARENTHESIS 0x26
147 #define HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS 0x27
148 #define HID_KEYBOARD_SC_ENTER 0x28
149 #define HID_KEYBOARD_SC_ESCAPE 0x29
150 #define HID_KEYBOARD_SC_BACKSPACE 0x2A
151 #define HID_KEYBOARD_SC_TAB 0x2B
152 #define HID_KEYBOARD_SC_SPACE 0x2C
153 #define HID_KEYBOARD_SC_MINUS_AND_UNDERSCORE 0x2D
154 #define HID_KEYBOARD_SC_EQUAL_AND_PLUS 0x2E
155 #define HID_KEYBOARD_SC_OPENING_BRACKET_AND_OPENING_BRACE 0x2F
156 #define HID_KEYBOARD_SC_CLOSING_BRACKET_AND_CLOSING_BRACE 0x30
157 #define HID_KEYBOARD_SC_BACKSLASH_AND_PIPE 0x31
158 #define HID_KEYBOARD_SC_NON_US_HASHMARK_AND_TILDE 0x32
159 #define HID_KEYBOARD_SC_SEMICOLON_AND_COLON 0x33
160 #define HID_KEYBOARD_SC_APOSTROPHE_AND_QUOTE 0x34
161 #define HID_KEYBOARD_SC_GRAVE_ACCENT_AND_TILDE 0x35
162 #define HID_KEYBOARD_SC_COMMA_AND_LESS_THAN_SIGN 0x36
163 #define HID_KEYBOARD_SC_DOT_AND_GREATER_THAN_SIGN 0x37
164 #define HID_KEYBOARD_SC_SLASH_AND_QUESTION_MARK 0x38
165 #define HID_KEYBOARD_SC_CAPS_LOCK 0x39
166 #define HID_KEYBOARD_SC_F1 0x3A
167 #define HID_KEYBOARD_SC_F2 0x3B
168 #define HID_KEYBOARD_SC_F3 0x3C
169 #define HID_KEYBOARD_SC_F4 0x3D
170 #define HID_KEYBOARD_SC_F5 0x3E
171 #define HID_KEYBOARD_SC_F6 0x3F
172 #define HID_KEYBOARD_SC_F7 0x40
173 #define HID_KEYBOARD_SC_F8 0x41
174 #define HID_KEYBOARD_SC_F9 0x42
175 #define HID_KEYBOARD_SC_F10 0x43
176 #define HID_KEYBOARD_SC_F11 0x44
177 #define HID_KEYBOARD_SC_F12 0x45
178 #define HID_KEYBOARD_SC_PRINT_SCREEN 0x46
179 #define HID_KEYBOARD_SC_SCROLL_LOCK 0x47
180 #define HID_KEYBOARD_SC_PAUSE 0x48
181 #define HID_KEYBOARD_SC_INSERT 0x49
182 #define HID_KEYBOARD_SC_HOME 0x4A
183 #define HID_KEYBOARD_SC_PAGE_UP 0x4B
184 #define HID_KEYBOARD_SC_DELETE 0x4C
185 #define HID_KEYBOARD_SC_END 0x4D
186 #define HID_KEYBOARD_SC_PAGE_DOWN 0x4E
187 #define HID_KEYBOARD_SC_RIGHT_ARROW 0xEF
188 #define HID_KEYBOARD_SC_LEFT_ARROW 0x50
189 #define HID_KEYBOARD_SC_DOWN_ARROW 0x51
190 #define HID_KEYBOARD_SC_UP_ARROW 0x52
191 #define HID_KEYBOARD_SC_NUM_LOCK 0x53
192 #define HID_KEYBOARD_SC_KEYPAD_SLASH 0x54
193 #define HID_KEYBOARD_SC_KEYPAD_ASTERISK 0x55
194 #define HID_KEYBOARD_SC_KEYPAD_MINUS 0x56
195 #define HID_KEYBOARD_SC_KEYPAD_PLUS 0x57
196 #define HID_KEYBOARD_SC_KEYPAD_ENTER 0x58
197 #define HID_KEYBOARD_SC_KEYPAD_1_AND_END 0x59
198 #define HID_KEYBOARD_SC_KEYPAD_2_AND_DOWN_ARROW 0x5A
199 #define HID_KEYBOARD_SC_KEYPAD_3_AND_PAGE_DOWN 0x5B
200 #define HID_KEYBOARD_SC_KEYPAD_4_AND_LEFT_ARROW 0x5C
201 #define HID_KEYBOARD_SC_KEYPAD_5 0x5D
202 #define HID_KEYBOARD_SC_KEYPAD_6_AND_RIGHT_ARROW 0x5E
203 #define HID_KEYBOARD_SC_KEYPAD_7_AND_HOME 0x5F
204 #define HID_KEYBOARD_SC_KEYPAD_8_AND_UP_ARROW 0x60
205 #define HID_KEYBOARD_SC_KEYPAD_9_AND_PAGE_UP 0x61
206 #define HID_KEYBOARD_SC_KEYPAD_0_AND_INSERT 0x62
207 #define HID_KEYBOARD_SC_KEYPAD_DOT_AND_DELETE 0x63
208 #define HID_KEYBOARD_SC_NON_US_BACKSLASH_AND_PIPE 0x64
209 #define HID_KEYBOARD_SC_EQUAL_SIGN 0x67
210 #define HID_KEYBOARD_SC_F13 0x68
211 #define HID_KEYBOARD_SC_F14 0x69
212 #define HID_KEYBOARD_SC_F15 0x6A
213 #define HID_KEYBOARD_SC_F16 0x6B
214 #define HID_KEYBOARD_SC_F17 0x6C
215 #define HID_KEYBOARD_SC_F18 0x6D
216 #define HID_KEYBOARD_SC_F19 0x6E
217 #define HID_KEYBOARD_SC_F20 0x6F
218 #define HID_KEYBOARD_SC_F21 0x70
219 #define HID_KEYBOARD_SC_F22 0x71
220 #define HID_KEYBOARD_SC_F23 0x72
221 #define HID_KEYBOARD_SC_F24 0x73
222 #define HID_KEYBOARD_SC_EXECUTE 0x74
223 #define HID_KEYBOARD_SC_HELP 0x75
224 #define HID_KEYBOARD_SC_MANU 0x76
225 #define HID_KEYBOARD_SC_SELECT 0x77
226 #define HID_KEYBOARD_SC_STOP 0x78
227 #define HID_KEYBOARD_SC_AGAIN 0x79
228 #define HID_KEYBOARD_SC_UNDO 0x7A
229 #define HID_KEYBOARD_SC_CUT 0x7B
230 #define HID_KEYBOARD_SC_COPY 0x7C
231 #define HID_KEYBOARD_SC_PASTE 0x7D
232 #define HID_KEYBOARD_SC_FIND 0x7E
233 #define HID_KEYBOARD_SC_MUTE 0x7F
234 #define HID_KEYBOARD_SC_VOLUME_UP 0x80
235 #define HID_KEYBOARD_SC_VOLUME_DOWN 0x81
236 #define HID_KEYBOARD_SC_LOCKING_CAPS_LOCK 0x82
237 #define HID_KEYBOARD_SC_LOCKING_NUM_LOCK 0x83
238 #define HID_KEYBOARD_SC_LOCKING_SCROLL_LOCK 0x84
239 #define HID_KEYBOARD_SC_KEYPAD_COMMA 0x85
240 #define HID_KEYBOARD_SC_KEYPAD_EQUAL_SIGN 0x86
241 #define HID_KEYBOARD_SC_INTERNATIONAL1 0x87
242 #define HID_KEYBOARD_SC_INTERNATIONAL2 0x88
243 #define HID_KEYBOARD_SC_INTERNATIONAL3 0x89
244 #define HID_KEYBOARD_SC_INTERNATIONAL4 0x8A
245 #define HID_KEYBOARD_SC_INTERNATIONAL5 0x8B
246 #define HID_KEYBOARD_SC_INTERNATIONAL6 0x8C
247 #define HID_KEYBOARD_SC_INTERNATIONAL7 0x8D
248 #define HID_KEYBOARD_SC_INTERNATIONAL8 0x8E
249 #define HID_KEYBOARD_SC_INTERNATIONAL9 0x8F
250 #define HID_KEYBOARD_SC_LANG1 0x90
251 #define HID_KEYBOARD_SC_LANG2 0x91
252 #define HID_KEYBOARD_SC_LANG3 0x92
253 #define HID_KEYBOARD_SC_LANG4 0x93
254 #define HID_KEYBOARD_SC_LANG5 0x94
255 #define HID_KEYBOARD_SC_LANG6 0x95
256 #define HID_KEYBOARD_SC_LANG7 0x96
257 #define HID_KEYBOARD_SC_LANG8 0x97
258 #define HID_KEYBOARD_SC_LANG9 0x98
259 #define HID_KEYBOARD_SC_ALTERNATE_ERASE 0x99
260 #define HID_KEYBOARD_SC_SISREQ 0x9A
261 #define HID_KEYBOARD_SC_CANCEL 0x9B
262 #define HID_KEYBOARD_SC_CLEAR 0x9C
263 #define HID_KEYBOARD_SC_PRIOR 0x9D
264 #define HID_KEYBOARD_SC_RETURN 0x9E
265 #define HID_KEYBOARD_SC_SEPARATOR 0x9F
266 #define HID_KEYBOARD_SC_OUT 0xA0
267 #define HID_KEYBOARD_SC_OPER 0xA1
268 #define HID_KEYBOARD_SC_CLEAR_AND_AGAIN 0xA2
269 #define HID_KEYBOARD_SC_CRSEL_ANDPROPS 0xA3
270 #define HID_KEYBOARD_SC_EXSEL 0xA4
271 #define HID_KEYBOARD_SC_KEYPAD_00 0xB0
272 #define HID_KEYBOARD_SC_KEYPAD_000 0xB1
273 #define HID_KEYBOARD_SC_THOUSANDS_SEPARATOR 0xB2
274 #define HID_KEYBOARD_SC_DECIMAL_SEPARATOR 0xB3
275 #define HID_KEYBOARD_SC_CURRENCY_UNIT 0xB4
276 #define HID_KEYBOARD_SC_CURRENCY_SUB_UNIT 0xB5
277 #define HID_KEYBOARD_SC_KEYPAD_OPENING_PARENTHESIS 0xB6
278 #define HID_KEYBOARD_SC_KEYPAD_CLOSING_PARENTHESIS 0xB7
279 #define HID_KEYBOARD_SC_KEYPAD_OPENING_BRACE 0xB8
280 #define HID_KEYBOARD_SC_KEYPAD_CLOSING_BRACE 0xB9
281 #define HID_KEYBOARD_SC_KEYPAD_TAB 0xBA
282 #define HID_KEYBOARD_SC_KEYPAD_BACKSPACE 0xBB
283 #define HID_KEYBOARD_SC_KEYPAD_A 0xBC
284 #define HID_KEYBOARD_SC_KEYPAD_B 0xBD
285 #define HID_KEYBOARD_SC_KEYPAD_C 0xBE
286 #define HID_KEYBOARD_SC_KEYPAD_D 0xBF
287 #define HID_KEYBOARD_SC_KEYPAD_E 0xC0
288 #define HID_KEYBOARD_SC_KEYPAD_F 0xC1
289 #define HID_KEYBOARD_SC_KEYPAD_XOR 0xC2
290 #define HID_KEYBOARD_SC_KEYPAD_CARET 0xC3
291 #define HID_KEYBOARD_SC_KEYPAD_PERCENTAGE 0xC4
292 #define HID_KEYBOARD_SC_KEYPAD_LESS_THAN_SIGN 0xC5
293 #define HID_KEYBOARD_SC_KEYPAD_GREATER_THAN_SIGN 0xC6
294 #define HID_KEYBOARD_SC_KEYPAD_AMP 0xC7
295 #define HID_KEYBOARD_SC_KEYPAD_AMP_AMP 0xC8
296 #define HID_KEYBOARD_SC_KEYPAD_PIPE 0xC9
297 #define HID_KEYBOARD_SC_KEYPAD_PIPE_PIPE 0xCA
298 #define HID_KEYBOARD_SC_KEYPAD_COLON 0xCB
299 #define HID_KEYBOARD_SC_KEYPAD_HASHMARK 0xCC
300 #define HID_KEYBOARD_SC_KEYPAD_SPACE 0xCD
301 #define HID_KEYBOARD_SC_KEYPAD_AT 0xCE
302 #define HID_KEYBOARD_SC_KEYPAD_EXCLAMATION_SIGN 0xCF
303 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_STORE 0xD0
304 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_RECALL 0xD1
305 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_CLEAR 0xD2
306 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_ADD 0xD3
307 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_SUBTRACT 0xD4
308 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_MULTIPLY 0xD5
309 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_DIVIDE 0xD6
310 #define HID_KEYBOARD_SC_KEYPAD_PLUS_AND_MINUS 0xD7
311 #define HID_KEYBOARD_SC_KEYPAD_CLEAR 0xD8
312 #define HID_KEYBOARD_SC_KEYPAD_CLEAR_ENTRY 0xD9
313 #define HID_KEYBOARD_SC_KEYPAD_BINARY 0xDA
314 #define HID_KEYBOARD_SC_KEYPAD_OCTAL 0xDB
315 #define HID_KEYBOARD_SC_KEYPAD_DECIMAL 0xDC
316 #define HID_KEYBOARD_SC_KEYPAD_HEXADECIMAL 0xDD
317 #define HID_KEYBOARD_SC_LEFT_CONTROL 0xE0
318 #define HID_KEYBOARD_SC_LEFT_SHIFT 0xE1
319 #define HID_KEYBOARD_SC_LEFT_ALT 0xE2
320 #define HID_KEYBOARD_SC_LEFT_GUI 0xE3
321 #define HID_KEYBOARD_SC_RIGHT_CONTROL 0xE4
322 #define HID_KEYBOARD_SC_RIGHT_SHIFT 0xE5
323 #define HID_KEYBOARD_SC_RIGHT_ALT 0xE6
324 #define HID_KEYBOARD_SC_RIGHT_GUI 0xE7
328 /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the HID
331 enum HID_Descriptor_ClassSubclassProtocol_t
333 HID_CSCP_HIDClass
= 0x03, /**< Descriptor Class value indicating that the device or interface
334 * belongs to the HID class.
336 HID_CSCP_NonBootSubclass
= 0x00, /**< Descriptor Subclass value indicating that the device or interface
337 * does not implement a HID boot protocol.
339 HID_CSCP_BootSubclass
= 0x01, /**< Descriptor Subclass value indicating that the device or interface
340 * implements a HID boot protocol.
342 HID_CSCP_NonBootProtocol
= 0x00, /**< Descriptor Protocol value indicating that the device or interface
343 * does not belong to a HID boot protocol.
345 HID_CSCP_KeyboardBootProtocol
= 0x01, /**< Descriptor Protocol value indicating that the device or interface
346 * belongs to the Keyboard HID boot protocol.
348 HID_CSCP_MouseBootProtocol
= 0x02, /**< Descriptor Protocol value indicating that the device or interface
349 * belongs to the Mouse HID boot protocol.
353 /** Enum for the HID class specific control requests that can be issued by the USB bus host. */
354 enum HID_ClassRequests_t
356 HID_REQ_GetReport
= 0x01, /**< HID class-specific Request to get the current HID report from the device. */
357 HID_REQ_GetIdle
= 0x02, /**< HID class-specific Request to get the current device idle count. */
358 HID_REQ_GetProtocol
= 0x03, /**< HID class-specific Request to get the current HID report protocol mode. */
359 HID_REQ_SetReport
= 0x09, /**< HID class-specific Request to set the current HID report to the device. */
360 HID_REQ_SetIdle
= 0x0A, /**< HID class-specific Request to set the device's idle count. */
361 HID_REQ_SetProtocol
= 0x0B, /**< HID class-specific Request to set the current HID report protocol mode. */
364 /** Enum for the HID class specific descriptor types. */
365 enum HID_DescriptorTypes_t
367 HID_DTYPE_HID
= 0x21, /**< Descriptor header type value, to indicate a HID class HID descriptor. */
368 HID_DTYPE_Report
= 0x22, /**< Descriptor header type value, to indicate a HID class HID report descriptor. */
371 /** Enum for the different types of HID reports. */
372 enum HID_ReportItemTypes_t
374 HID_REPORT_ITEM_In
= 0, /**< Indicates that the item is an IN report type. */
375 HID_REPORT_ITEM_Out
= 1, /**< Indicates that the item is an OUT report type. */
376 HID_REPORT_ITEM_Feature
= 2, /**< Indicates that the item is a FEATURE report type. */
379 /** \brief HID class-specific HID Descriptor (LUFA naming conventions).
381 * Type define for the HID class-specific HID descriptor, to describe the HID device's specifications. Refer to the HID
382 * specification for details on the structure elements.
384 * \see \ref USB_HID_StdDescriptor_HID_t for the version of this type with standard element names.
388 USB_Descriptor_Header_t Header
; /**< Regular descriptor header containing the descriptor's type and length. */
390 uint16_t HIDSpec
; /**< BCD encoded version that the HID descriptor and device complies to. */
391 uint8_t CountryCode
; /**< Country code of the localized device, or zero if universal. */
393 uint8_t TotalReportDescriptors
; /**< Total number of HID report descriptors for the interface. */
395 uint8_t HIDReportType
; /**< Type of HID report, set to \ref HID_DTYPE_Report. */
396 uint16_t HIDReportLength
; /**< Length of the associated HID report descriptor, in bytes. */
397 } USB_HID_Descriptor_HID_t
;
399 /** \brief HID class-specific HID Descriptor (USB-IF naming conventions).
401 * Type define for the HID class-specific HID descriptor, to describe the HID device's specifications. Refer to the HID
402 * specification for details on the structure elements.
404 * \see \ref USB_HID_Descriptor_HID_t for the version of this type with non-standard LUFA specific
409 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
410 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
411 * given by the specific class.
414 uint16_t bcdHID
; /**< BCD encoded version that the HID descriptor and device complies to. */
415 uint8_t bCountryCode
; /**< Country code of the localized device, or zero if universal. */
417 uint8_t bNumDescriptors
; /**< Total number of HID report descriptors for the interface. */
419 uint8_t bDescriptorType2
; /**< Type of HID report, set to \ref HID_DTYPE_Report. */
420 uint16_t wDescriptorLength
; /**< Length of the associated HID report descriptor, in bytes. */
421 } USB_HID_StdDescriptor_HID_t
;
423 /** \brief Standard HID Boot Protocol Mouse Report.
425 * Type define for a standard Boot Protocol Mouse report
429 uint8_t Button
; /**< Button mask for currently pressed buttons in the mouse. */
430 int8_t X
; /**< Current delta X movement of the mouse. */
431 int8_t Y
; /**< Current delta Y movement on the mouse. */
432 } USB_MouseReport_Data_t
;
434 /** \brief Standard HID Boot Protocol Keyboard Report.
436 * Type define for a standard Boot Protocol Keyboard report
440 uint8_t Modifier
; /**< Keyboard modifier byte, indicating pressed modifier keys (a combination of
441 * \c HID_KEYBOARD_MODIFER_* masks).
443 uint8_t Reserved
; /**< Reserved for OEM use, always set to 0. */
444 uint8_t KeyCode
[6]; /**< Key codes of the currently pressed keys. */
445 } USB_KeyboardReport_Data_t
;
447 /** Type define for the data type used to store HID report descriptor elements. */
448 typedef uint8_t USB_Descriptor_HIDReport_Datatype_t
;