1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** USBX Component                                                        */
17 /**                                                                       */
18 /**   HID Class                                                           */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /**************************************************************************/
25 /*                                                                        */
26 /*  COMPONENT DEFINITION                                   RELEASE        */
27 /*                                                                        */
28 /*    ux_host_class_hid.h                                 PORTABLE C      */
29 /*                                                           6.3.0        */
30 /*  AUTHOR                                                                */
31 /*                                                                        */
32 /*    Chaoqiong Xiao, Microsoft Corporation                               */
33 /*                                                                        */
34 /*  DESCRIPTION                                                           */
35 /*                                                                        */
36 /*    This file contains all the header and extern functions used by the  */
37 /*    USBX HID class.                                                     */
38 /*                                                                        */
39 /*  RELEASE HISTORY                                                       */
40 /*                                                                        */
41 /*    DATE              NAME                      DESCRIPTION             */
42 /*                                                                        */
43 /*  05-19-2020     Chaoqiong Xiao           Initial Version 6.0           */
44 /*  09-30-2020     Chaoqiong Xiao           Modified comment(s),          */
45 /*                                            used UX prefix to refer to  */
46 /*                                            TX symbols instead of using */
47 /*                                            them directly, fixed struct */
48 /*                                            field definition issues,    */
49 /*                                            resulting in version 6.1    */
50 /*  08-02-2021     Wen Wang                 Modified comment(s),          */
51 /*                                            added extern "C" keyword    */
52 /*                                            for compatibility with C++, */
53 /*                                            resulting in version 6.1.8  */
54 /*  01-31-2022     Xiuwen Cai, CQ Xiao      Modified comment(s),          */
55 /*                                            added interrupt OUT support,*/
56 /*                                            added standalone mode,      */
57 /*                                            resulting in version 6.1.10 */
58 /*  10-31-2023     Chaoqiong Xiao           Modified comment(s),          */
59 /*                                            optimized USB descriptors,  */
60 /*                                            resulting in version 6.3.0  */
61 /*                                                                        */
62 /**************************************************************************/
63 
64 #ifndef UX_HOST_CLASS_HID_H
65 #define UX_HOST_CLASS_HID_H
66 
67 /* Determine if a C++ compiler is being used.  If so, ensure that standard
68    C is used to process the API information.  */
69 
70 #ifdef   __cplusplus
71 
72 /* Yes, C++ compiler is present.  Use standard C.  */
73 extern   "C" {
74 
75 #endif
76 
77 
78 /* Internal option: enable the basic USBX error checking. This define is typically used
79    while debugging application.  */
80 #if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_HID_ENABLE_ERROR_CHECKING)
81 #define UX_DEVICE_CLASS_HID_ENABLE_ERROR_CHECKING
82 #endif
83 
84 
85 /* Define HID Class constants.  */
86 
87 #define UX_HOST_CLASS_HID_CLASS                                 3
88 #define UX_HOST_CLASS_HID_FIELDS                                16
89 #define UX_HOST_CLASS_HID_MAX_COLLECTION                        4
90 #define UX_HOST_CLASS_HID_MAX_REPORT                            8
91 #define UX_HOST_CLASS_HID_REPORT_SIZE                           32
92 #define UX_HOST_CLASS_HID_DESCRIPTOR                            0x21
93 #define UX_HOST_CLASS_HID_ITEM_LENGTH_MASK                      3
94 #define UX_HOST_CLASS_HID_ITEM_TAG_MASK                         0xf0
95 #define UX_HOST_CLASS_HID_ITEM_TAG_SHORT                        1
96 #define UX_HOST_CLASS_HID_ITEM_TAG_LONG                         0xf0
97 #define UX_HOST_CLASS_HID_MAX_CLIENTS                           8
98 #define UX_HOST_CLASS_HID_MAX_CLIENT_NAME_LENGTH                63 /* Exclude string null-terminator */
99 
100 #ifndef UX_HOST_CLASS_HID_DECOMPRESSION_BUFFER
101 #define UX_HOST_CLASS_HID_DECOMPRESSION_BUFFER                  4096
102 #endif
103 #define UX_HOST_CLASS_HID_REPORT_DECOMPRESSED                   0
104 #define UX_HOST_CLASS_HID_REPORT_RAW                            1
105 #define UX_HOST_CLASS_HID_REPORT_INDIVIDUAL_USAGE               2
106 #define UX_HOST_CLASS_HID_INTERRUPT_ENDPOINT_READY              1
107 #define UX_HOST_CLASS_HID_INTERRUPT_ENDPOINT_ACTIVE             2
108 
109 
110 /* Define HID Class item types.  */
111 
112 #define UX_HOST_CLASS_HID_TYPE_MAIN                             0x0
113 #define UX_HOST_CLASS_HID_TYPE_GLOBAL                           0x1
114 #define UX_HOST_CLASS_HID_TYPE_LOCAL                            0x2
115 #define UX_HOST_CLASS_HID_TYPE_RESERVED                         0x3
116 
117 
118 /* Define HID Class main tags.  */
119 
120 #define UX_HOST_CLASS_HID_MAIN_TAG_INPUT                        0x8
121 #define UX_HOST_CLASS_HID_MAIN_TAG_OUTPUT                       0x9
122 #define UX_HOST_CLASS_HID_MAIN_TAG_FEATURE                      0xb
123 #define UX_HOST_CLASS_HID_MAIN_TAG_COLLECTION                   0xa
124 #define UX_HOST_CLASS_HID_MAIN_TAG_END_COLLECTION               0xc
125 
126 
127 /* Define HID Class global tags.  */
128 
129 #define UX_HOST_CLASS_HID_GLOBAL_TAG_USAGE_PAGE                 0x0
130 #define UX_HOST_CLASS_HID_GLOBAL_TAG_LOGICAL_MINIMUM            0x1
131 #define UX_HOST_CLASS_HID_GLOBAL_TAG_LOGICAL_MAXIMUM            0x2
132 #define UX_HOST_CLASS_HID_GLOBAL_TAG_PHYSICAL_MINIMUM           0x3
133 #define UX_HOST_CLASS_HID_GLOBAL_TAG_PHYSICAL_MAXIMUM           0x4
134 #define UX_HOST_CLASS_HID_GLOBAL_TAG_UNIT_EXPONENT              0x5
135 #define UX_HOST_CLASS_HID_GLOBAL_TAG_UNIT                       0x6
136 #define UX_HOST_CLASS_HID_GLOBAL_TAG_REPORT_SIZE                0x7
137 #define UX_HOST_CLASS_HID_GLOBAL_TAG_REPORT_ID                  0x8
138 #define UX_HOST_CLASS_HID_GLOBAL_TAG_REPORT_COUNT               0x9
139 #define UX_HOST_CLASS_HID_GLOBAL_TAG_PUSH                       0xa
140 #define UX_HOST_CLASS_HID_GLOBAL_TAG_POP                        0xb
141 
142 
143 /* Define HID Class local tags.  */
144 
145 #define UX_HOST_CLASS_HID_LOCAL_TAG_USAGE                       0x0
146 #define UX_HOST_CLASS_HID_LOCAL_TAG_USAGE_MINIMUM               0x1
147 #define UX_HOST_CLASS_HID_LOCAL_TAG_USAGE_MAXIMUM               0x2
148 #define UX_HOST_CLASS_HID_LOCAL_TAG_DESIGNATOR_INDEX            0x3
149 #define UX_HOST_CLASS_HID_LOCAL_TAG_DESIGNATOR_MINIMUM          0x4
150 #define UX_HOST_CLASS_HID_LOCAL_TAG_DESIGNATOR_MAXIMUM          0x5
151 #define UX_HOST_CLASS_HID_LOCAL_TAG_STRING_INDEX                0x7
152 #define UX_HOST_CLASS_HID_LOCAL_TAG_STRING_MINIMUM              0x8
153 #define UX_HOST_CLASS_HID_LOCAL_TAG_STRING_MAXIMUM              0x9
154 #define UX_HOST_CLASS_HID_LOCAL_TAG_DELIMITER                   0xa
155 
156 
157 /* Define HID Class collection item types.  */
158 
159 #define UX_HOST_CLASS_HID_COLLECTION_PHYSICAL                   0
160 #define UX_HOST_CLASS_HID_COLLECTION_APPLICATION                1
161 #define UX_HOST_CLASS_HID_COLLECTION_LOGICAL                    2
162 
163 
164 /* Define HID Class delimiter set.  */
165 
166 #define UX_HOST_CLASS_HID_DELIMITER_OPEN                        1
167 #define UX_HOST_CLASS_HID_DELIMITER_CLOSE                       0
168 
169 
170 /* Define HID Class item bit masks.  */
171 
172 #define UX_HOST_CLASS_HID_ITEM_CONSTANT                         0x0001
173 #define UX_HOST_CLASS_HID_ITEM_VARIABLE                         0x0002
174 #define UX_HOST_CLASS_HID_ITEM_RELATIVE                         0x0004
175 #define UX_HOST_CLASS_HID_ITEM_WRAP                             0x0008
176 #define UX_HOST_CLASS_HID_ITEM_NON_LINEAR                       0x0010
177 #define UX_HOST_CLASS_HID_ITEM_NO_PREFERRED_STATE               0x0020
178 #define UX_HOST_CLASS_HID_ITEM_NULL_STATE                       0x0040
179 #define UX_HOST_CLASS_HID_ITEM_VOLATILE                         0x0080
180 #define UX_HOST_CLASS_HID_ITEM_BUFFERED_BYTES                   0x0100
181 
182 
183 /* Define HID Class commands.  */
184 
185 #define UX_HOST_CLASS_HID_GET_REPORT                            0x01
186 #define UX_HOST_CLASS_HID_GET_IDLE                              0x02
187 #define UX_HOST_CLASS_HID_GET_PROTOCOL                          0x03
188 #define UX_HOST_CLASS_HID_SET_REPORT                            0x09
189 #define UX_HOST_CLASS_HID_SET_IDLE                              0x0A
190 #define UX_HOST_CLASS_HID_SET_PROTOCOL                          0x0B
191 
192 
193 /* Define HID Class descriptors.  */
194 
195 #define UX_HOST_CLASS_HID_DESCRIPTOR                            0x21
196 #define UX_HOST_CLASS_HID_REPORT_DESCRIPTOR                     0x22
197 #define UX_HOST_CLASS_HID_PHYSICAL_DESCRIPTOR                   0x23
198 
199 
200 #define UX_HID_DESCRIPTOR_ENTRIES                               7
201 #define UX_HID_DESCRIPTOR_LENGTH                                9
202 
203 
204 /* Define HID Class page constants.  */
205 
206 #define UX_HOST_CLASS_HID_PAGE_GENERIC_DESKTOP_CONTROLS         0x01
207 #define UX_HOST_CLASS_HID_PAGE_SIMULATION_CONTROLS              0x02
208 #define UX_HOST_CLASS_HID_PAGE_VR_CONTROLS                      0x03
209 #define UX_HOST_CLASS_HID_PAGE_SPORT_CONTROLS                   0x04
210 #define UX_HOST_CLASS_HID_PAGE_GAME_CONTROLS                    0x05
211 #define UX_HOST_CLASS_HID_PAGE_GENERIC_DEVICE_CONTROLS          0x06
212 #define UX_HOST_CLASS_HID_PAGE_KEYBOARD_KEYPAD                  0x07
213 #define UX_HOST_CLASS_HID_PAGE_LEDS                             0x08
214 #define UX_HOST_CLASS_HID_PAGE_BUTTON                           0x09
215 #define UX_HOST_CLASS_HID_PAGE_ORDINAL                          0x0A
216 #define UX_HOST_CLASS_HID_PAGE_TELEPHONY                        0x0B
217 #define UX_HOST_CLASS_HID_PAGE_CONSUMER                         0x0C
218 #define UX_HOST_CLASS_HID_PAGE_DIGITIZER                        0x0D
219 #define UX_HOST_CLASS_HID_PAGE_PHYSICAL_INTERFACE_DEVICE        0x0F
220 #define UX_HOST_CLASS_HID_PAGE_UNICODE                          0x10
221 #define UX_HOST_CLASS_HID_PAGE_ALPHANUMERIC_DISPLAY             0x14
222 #define UX_HOST_CLASS_HID_PAGE_MEDICAL_INSTRUMENTS              0x40
223 #define UX_HOST_CLASS_HID_PAGE_BAR_CODE_SCANNER                 0x8C
224 #define UX_HOST_CLASS_HID_PAGE_SCALE_PAGE                       0x8D
225 #define UX_HOST_CLASS_HID_PAGE_MAGNETIC_STRIPE_READING          0x8E
226 #define UX_HOST_CLASS_HID_PAGE_CAMERA_CONTROL_PAGE              0x90
227 
228 
229 /* Define HID Class generic desktop page constants.  */
230 
231 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_UNDEFINED             0x00
232 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_POINTER               0x01
233 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_MOUSE                 0x02
234 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RESERVED              0x03
235 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_JOYSTICK              0x04
236 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_GAME PAD              0x05
237 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_KEYBOARD              0x06
238 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_KEYPAD                0x07
239 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_MULTI_AXIS_CONTROLLER 0x08
240 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_X                     0x30
241 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_Y                     0x31
242 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_Z                     0x32
243 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RX                    0x33
244 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RY                    0x34
245 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RZ                    0x35
246 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SLIDER                0x36
247 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_DIAL                  0x37
248 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_WHEEL                 0x38
249 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_HAT_SWITCH            0x39
250 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_COUNTED_BUFFER        0x3A
251 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_BYTE_COUNT            0x3B
252 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_MOTION_WAKEUP         0x3C
253 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_START                 0x3D
254 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SELECT                0x3E
255 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VX                    0x40
256 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VY                    0x41
257 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VZ                    0x42
258 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VBRX                  0x43
259 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VBRY                  0x44
260 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VBRZ                  0x45
261 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VNO                   0x46
262 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_FEATURE_NOTIFICATION  0x47
263 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_CONTROL        0x80
264 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_POWER_DOWN     0x81
265 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_SLEEP          0x82
266 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_WAKE_UP        0x83
267 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_CONTEXT_MENU   0x84
268 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MAIN_MENU      0x85
269 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_APP_MENU       0x86
270 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_HELP      0x87
271 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_EXIT      0x88
272 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_SELECT    0x89
273 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_RIGHT     0x8A
274 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_LEFT      0x8B
275 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_UP        0x8C
276 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_DOWN      0x8D
277 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_COLD_RESTART   0x8E
278 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_WARM_RESTART   0x8F
279 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_UP              0x90
280 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_DOWN            0x91
281 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_RIGHT           0x92
282 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_LEFT            0x93
283 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DOCK           0xA0
284 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_UNDOCK         0xA1
285 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_SETUP          0xA2
286 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_BREAK          0xA3
287 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DEBUGGER_BREAK 0xA4
288 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_APPLICAION_BREAK      0xA5
289 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_APPLICATION_DEBUGGER_BREAK 0xA6
290 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_SPEAKER_MUTE   0xA7
291 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_HIBERNATE      0xA8
292 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_INVERT 0xB0
293 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_INTERNAL 0xB1
294 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_EXTERNAL 0xB2
295 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_BOTH   0xB3
296 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_DUAL   0xB4
297 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_TOGGLE 0xB5
298 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_SWAP   0xB6
299 #define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_LCD_AUTOSCALE 0xB7
300 
301 
302 /* Define HID Class game control page constants.  */
303 
304 #define UX_HOST_CLASS_HID_GAME_CONTROL_UNDEFINED                0x00
305 #define UX_HOST_CLASS_HID_GAME_CONTROL_3D_GAME_CONTROLLER       0x01
306 #define UX_HOST_CLASS_HID_GAME_CONTROL_PINBALL_DEVICE           0x02
307 #define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_DEVICE               0x03
308 #define UX_HOST_CLASS_HID_GAME_CONTROL_POINT_OF_VIEW            0x20
309 #define UX_HOST_CLASS_HID_GAME_CONTROL_TURN_RIGHT_LEFT          0x21
310 #define UX_HOST_CLASS_HID_GAME_CONTROL_PITCH_FORWARD_BACKWARD   0x22
311 #define UX_HOST_CLASS_HID_GAME_CONTROL_ROLL_RIGHT_LEFT          0x23
312 #define UX_HOST_CLASS_HID_GAME_CONTROL_MOVE_RIGHT_LEFT          0x24
313 #define UX_HOST_CLASS_HID_GAME_CONTROL_MOVE_FORWARD_BACKWARD    0x25
314 #define UX_HOST_CLASS_HID_GAME_CONTROL_MOVE_UP_DOWN             0x26
315 #define UX_HOST_CLASS_HID_GAME_CONTROL_LEAN_RIGHT_LEFT          0x27
316 #define UX_HOST_CLASS_HID_GAME_CONTROL_LEAN_FORWARD_BACKWARD    0x28
317 #define UX_HOST_CLASS_HID_GAME_CONTROL_HEIGHT_OF_POV            0x29
318 #define UX_HOST_CLASS_HID_GAME_CONTROL_FLIPPER                  0x2A
319 #define UX_HOST_CLASS_HID_GAME_CONTROL_SECONDARY_FLIPPER        0x2B
320 #define UX_HOST_CLASS_HID_GAME_CONTROL_BUMP                     0x2C
321 #define UX_HOST_CLASS_HID_GAME_CONTROL_NEW_GAME                 0x2D
322 #define UX_HOST_CLASS_HID_GAME_CONTROL_SHOOT_BALL               0x2E
323 #define UX_HOST_CLASS_HID_GAME_CONTROL_PLAYER                   0x2F
324 #define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_BOLT                 0x30
325 #define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_CLIP                 0x31
326 #define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_SELECTOR             0x32
327 #define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_SINGLE_SHOT          0x33
328 #define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_BURST                0x34
329 #define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_AUTOMATIC            0x35
330 #define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_SAFETY               0x36
331 #define UX_HOST_CLASS_HID_GAME_CONTROL_GAMEAD_FIRE_JUMP         0x37
332 #define UX_HOST_CLASS_HID_GAME_CONTROL_GAMEPAD_TRIGGER          0x39
333 
334 
335 /* Define HID Class LED page constants.  */
336 
337 #define UX_HOST_CLASS_HID_LED_UNDEFINED                         0x00
338 #define UX_HOST_CLASS_HID_LED_NUM_LOCK                          0x01
339 #define UX_HOST_CLASS_HID_LED_CAPS_LOCK                         0x02
340 #define UX_HOST_CLASS_HID_LED_SCROLL_LOCK                       0x03
341 #define UX_HOST_CLASS_HID_LED_COMPOSE                           0x04
342 #define UX_HOST_CLASS_HID_LED_KANA                              0x05
343 #define UX_HOST_CLASS_HID_LED_POWER                             0x06
344 #define UX_HOST_CLASS_HID_LED_SHIFT                             0x07
345 #define UX_HOST_CLASS_HID_LED_DO_NOT_DISTURB                    0x08
346 #define UX_HOST_CLASS_HID_LED_MUTE                              0x09
347 #define UX_HOST_CLASS_HID_LED_TONE_ENABLE                       0x0A
348 #define UX_HOST_CLASS_HID_LED_HIGH_CUT_FILTER                   0x0B
349 #define UX_HOST_CLASS_HID_LED_LOW_CUT_FILTER                    0x0C
350 #define UX_HOST_CLASS_HID_LED_EQUALIZER_ENABLE                  0x0D
351 #define UX_HOST_CLASS_HID_LED_SOUND_FIELD_ON                    0x0E
352 #define UX_HOST_CLASS_HID_LED_SURROUND_ON                       0x0F
353 #define UX_HOST_CLASS_HID_LED_REPEAT                            0x10
354 #define UX_HOST_CLASS_HID_LED_STEREO                            0x11
355 #define UX_HOST_CLASS_HID_LED_SAMPLING_RATE_DETECT              0x12
356 #define UX_HOST_CLASS_HID_LED_SPINNING                          0x13
357 #define UX_HOST_CLASS_HID_LED_CAV                               0x14
358 #define UX_HOST_CLASS_HID_LED_CLV                               0x15
359 #define UX_HOST_CLASS_HID_LED_RECORDING_FORMAT_DETECT           0x16
360 #define UX_HOST_CLASS_HID_LED_OFF_HOOK                          0x17
361 #define UX_HOST_CLASS_HID_LED_RING                              0x18
362 #define UX_HOST_CLASS_HID_LED_MESSAGE_WAITING                   0x19
363 #define UX_HOST_CLASS_HID_LED_DATA_MODE                         0x1A
364 #define UX_HOST_CLASS_HID_LED_BATTERY_OPERATION                 0x1B
365 #define UX_HOST_CLASS_HID_LED_BATTERY_OK                        0x1C
366 #define UX_HOST_CLASS_HID_LED_BATTERY_LOW                       0x1D
367 #define UX_HOST_CLASS_HID_LED_SPEAKER                           0x1E
368 #define UX_HOST_CLASS_HID_LED_HEAD_SET                          0x1F
369 #define UX_HOST_CLASS_HID_LED_HOLD                              0x20
370 #define UX_HOST_CLASS_HID_LED_MICROPHONE                        0x21
371 #define UX_HOST_CLASS_HID_LED_COVERAGE                          0x22
372 #define UX_HOST_CLASS_HID_LED_NIGHT_MODE                        0x23
373 #define UX_HOST_CLASS_HID_LED_SEND_CALLS                        0x24
374 #define UX_HOST_CLASS_HID_LED_CALL_PICKUP                       0x25
375 #define UX_HOST_CLASS_HID_LED_CONFERENCE                        0x26
376 #define UX_HOST_CLASS_HID_LED_STAND_BY                          0x27
377 #define UX_HOST_CLASS_HID_LED_CAMERA_ON                         0x28
378 #define UX_HOST_CLASS_HID_LED_CAMERA_OFF                        0x29
379 #define UX_HOST_CLASS_HID_LED_ON_LINE                           0x2A
380 #define UX_HOST_CLASS_HID_LED_OFF_LINE                          0x2B
381 #define UX_HOST_CLASS_HID_LED_BUSY                              0x2C
382 #define UX_HOST_CLASS_HID_LED_READY                             0x2D
383 #define UX_HOST_CLASS_HID_LED_PAPER_OUT                         0x2E
384 #define UX_HOST_CLASS_HID_LED_PAPER_JAM                         0x2F
385 #define UX_HOST_CLASS_HID_LED_REMOTE                            0x30
386 #define UX_HOST_CLASS_HID_LED_FORWARD                           0x31
387 #define UX_HOST_CLASS_HID_LED_REVERSE                           0x32
388 #define UX_HOST_CLASS_HID_LED_STOP                              0x33
389 #define UX_HOST_CLASS_HID_LED_REWIND                            0x34
390 #define UX_HOST_CLASS_HID_LED_FAST_FORWARD                      0x35
391 #define UX_HOST_CLASS_HID_LED_PLAY                              0x36
392 #define UX_HOST_CLASS_HID_LED_PAUSE                             0x37
393 #define UX_HOST_CLASS_HID_LED_RECORD                            0x38
394 #define UX_HOST_CLASS_HID_LED_ERROR                             0x39
395 #define UX_HOST_CLASS_HID_LED_USAGE_SELECTED_INDICATOR          0x3A
396 #define UX_HOST_CLASS_HID_LED_USAGE_IN_USE_INDICATOR            0x3B
397 #define UX_HOST_CLASS_HID_LED_USAGE MULTI_MODE_INDICATOR        0x3C
398 #define UX_HOST_CLASS_HID_LED_INDICATOR_ON                      0x3D
399 #define UX_HOST_CLASS_HID_LED_INDICATOR_FLASH                   0x3E
400 #define UX_HOST_CLASS_HID_LED_INDICATOR_SLOW_BLINK              0x3F
401 #define UX_HOST_CLASS_HID_LED_INDICATOR_FAST_BLINK              0x40
402 #define UX_HOST_CLASS_HID_LED_INDICATOR_OFF                     0x41
403 #define UX_HOST_CLASS_HID_LED_FLASH_ON_TIME                     0x42
404 #define UX_HOST_CLASS_HID_LED_SLOW_BLINK_ON_TIME                0x43
405 #define UX_HOST_CLASS_HID_LED_SLOW_BLINK_OFF_TIME               0x44
406 #define UX_HOST_CLASS_HID_LED_FAST_BLINK_ON_TIME                0x45
407 #define UX_HOST_CLASS_HID_LED_FAST_BLINK_OFF_TIME               0x46
408 #define UX_HOST_CLASS_HID_LED_USAGE_INDICATOR_COLOR             0x47
409 #define UX_HOST_CLASS_HID_LED_INDICATOR_RED                     0x48
410 #define UX_HOST_CLASS_HID_LED_INDICATOR_GREEN                   0x49
411 #define UX_HOST_CLASS_HID_LED_INDICATOR_AMBER                   0x4A
412 #define UX_HOST_CLASS_HID_LED_GENERIC_INDICATOR                 0x4B
413 #define UX_HOST_CLASS_HID_LED_SYSTEM_SUSPEND                    0x4C
414 #define UX_HOST_CLASS_HID_LED_EXTERNAL_POWER_CONNECTED          0x4D
415 
416 
417 /* Define HID Class consumer page constants.  */
418 
419 #define UX_HOST_CLASS_HID_CONSUMER_UNASSIGNED                   0x00
420 #define UX_HOST_CLASS_HID_CONSUMER_REMOTE_CONTROL               0x01
421 #define UX_HOST_CLASS_HID_CONSUMER_NUMERIC_KEY_PAD              0x02
422 #define UX_HOST_CLASS_HID_CONSUMER_PROGRAMMABLE_BUTTONS         0x03
423 #define UX_HOST_CLASS_HID_CONSUMER_MICROPHONE                   0x04
424 #define UX_HOST_CLASS_HID_CONSUMER_HEADPHONE                    0x05
425 #define UX_HOST_CLASS_HID_CONSUMER_GRAPHIC_EQUALIZER            0x06
426 #define UX_HOST_CLASS_HID_CONSUMER_PLUS_10                      0x20
427 #define UX_HOST_CLASS_HID_CONSUMER_PLUS_100                     0x21
428 #define UX_HOST_CLASS_HID_CONSUMER_AM_PM                        0x22
429 #define UX_HOST_CLASS_HID_CONSUMER_POWER                        0x30
430 #define UX_HOST_CLASS_HID_CONSUMER_RESET                        0x31
431 #define UX_HOST_CLASS_HID_CONSUMER_SLEEP                        0x32
432 #define UX_HOST_CLASS_HID_CONSUMER_SLEEP_AFTER                  0x33
433 #define UX_HOST_CLASS_HID_CONSUMER_SLEEP_MODE_RTC               0x34
434 #define UX_HOST_CLASS_HID_CONSUMER_ILLUMINATION                 0x35
435 #define UX_HOST_CLASS_HID_CONSUMER_FUNCTION_BUTTONS             0x36
436 #define UX_HOST_CLASS_HID_CONSUMER_MENU                         0x40
437 #define UX_HOST_CLASS_HID_CONSUMER_MENU_PICK                    0x41
438 #define UX_HOST_CLASS_HID_CONSUMER_MENU_UP                      0x42
439 #define UX_HOST_CLASS_HID_CONSUMER_MENU_DOWN                    0x43
440 #define UX_HOST_CLASS_HID_CONSUMER_MENU_LEFT                    0x44
441 #define UX_HOST_CLASS_HID_CONSUMER_MENU_RIGHT                   0x45
442 #define UX_HOST_CLASS_HID_CONSUMER_MENU_ESCAPE                  0x46
443 #define UX_HOST_CLASS_HID_CONSUMER_MENU_VALUE_INCREASE          0x47
444 #define UX_HOST_CLASS_HID_CONSUMER_MENU_VALUE_DECREASE          0x48
445 #define UX_HOST_CLASS_HID_CONSUMER_DATA_ON_SCREEN               0x60
446 #define UX_HOST_CLASS_HID_CONSUMER_CLOSED_CAPTION               0x61
447 #define UX_HOST_CLASS_HID_CONSUMER_CLOSED_CAPTION_SELECT        0x62
448 #define UX_HOST_CLASS_HID_CONSUMER_VCR_TV                       0x63
449 #define UX_HOST_CLASS_HID_CONSUMER_BROADCAST_MODE               0x64
450 #define UX_HOST_CLASS_HID_CONSUMER_SNAPSHOT                     0x65
451 #define UX_HOST_CLASS_HID_CONSUMER_STILL                        0x66
452 #define UX_HOST_CLASS_HID_CONSUMER_SELECTION                    0x80
453 #define UX_HOST_CLASS_HID_CONSUMER_ASSIGN_SELECTION             0x81
454 #define UX_HOST_CLASS_HID_CONSUMER_MODE_STEP                    0x82
455 #define UX_HOST_CLASS_HID_CONSUMER_RECALL_LAST                  0x83
456 #define UX_HOST_CLASS_HID_CONSUMER_ENTER_CHANNEL                0x84
457 #define UX_HOST_CLASS_HID_CONSUMER_ORDER_MOVIE                  0x85
458 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_L                    0x86
459 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECTION              0x87
460 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_COMPUTER        0x88
461 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_TV              0x89
462 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_WWW             0x8A
463 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_DVD             0x8B
464 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_TELEPHONE       0x8C
465 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_PROGRAM_GUIDE   0x8D
466 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_VIDEO_PHONE     0x8E
467 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_GAMES           0x8F
468 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_MESSAGES        0x90
469 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_CD              0x91
470 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_VCR             0x92
471 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_TUNER           0x93
472 #define UX_HOST_CLASS_HID_CONSUMER_QUIT                         0x94
473 #define UX_HOST_CLASS_HID_CONSUMER_HELP                         0x95
474 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_TAPE            0x96
475 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_CABLE           0x97
476 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_SATELLITE       0x98
477 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_SECURITY        0x99
478 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_HOME            0x9A
479 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT_CALL            0x9B
480 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_INCREMENT            0x9C
481 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_DECREMENT            0x9D
482 #define UX_HOST_CLASS_HID_CONSUMER_MEDIA_SELECT                 0x9E
483 #define UX_HOST_CLASS_HID_CONSUMER_VCR_PLUS                     0xA0
484 #define UX_HOST_CLASS_HID_CONSUMER_ONCE                         0xA1
485 #define UX_HOST_CLASS_HID_CONSUMER_DAILY                        0xA2
486 #define UX_HOST_CLASS_HID_CONSUMER_WEEKLY                       0xA3
487 #define UX_HOST_CLASS_HID_CONSUMER_MONTHLY                      0xA4
488 #define UX_HOST_CLASS_HID_CONSUMER_PLAY                         0xB0
489 #define UX_HOST_CLASS_HID_CONSUMER_PAUSE                        0xB1
490 #define UX_HOST_CLASS_HID_CONSUMER_RECORD                       0xB2
491 #define UX_HOST_CLASS_HID_CONSUMER_FAST_FORWARD                 0xB3
492 #define UX_HOST_CLASS_HID_CONSUMER_REWIND                       0xB4
493 #define UX_HOST_CLASS_HID_CONSUMER_SCAN_NEXT_TRACK              0xB5
494 #define UX_HOST_CLASS_HID_CONSUMER_SCAN_PREVIOUS_TRACK          0xB6
495 #define UX_HOST_CLASS_HID_CONSUMER_STOP                         0xB7
496 #define UX_HOST_CLASS_HID_CONSUMER_EJECT                        0xB8
497 #define UX_HOST_CLASS_HID_CONSUMER_RANDOM_PLAY                  0xB9
498 #define UX_HOST_CLASS_HID_CONSUMER_SELECT_DISC                  0xBA
499 #define UX_HOST_CLASS_HID_CONSUMER_ENTER_DISC                   0xBB
500 #define UX_HOST_CLASS_HID_CONSUMER_REPEAT                       0xBC
501 #define UX_HOST_CLASS_HID_CONSUMER_TRACKING                     0xBD
502 #define UX_HOST_CLASS_HID_CONSUMER_TRACK_NORMAL                 0xBE
503 #define UX_HOST_CLASS_HID_CONSUMER_SLOW_TRACKING                0xBF
504 #define UX_HOST_CLASS_HID_CONSUMER_FRAME_FORWARD                0xC0
505 #define UX_HOST_CLASS_HID_CONSUMER_FRAME_BACK                   0xC1
506 #define UX_HOST_CLASS_HID_CONSUMER_MARK                         0xC2
507 #define UX_HOST_CLASS_HID_CONSUMER_CLEAR_MARK                   0xC3
508 #define UX_HOST_CLASS_HID_CONSUMER_REPEAT_FROM_MARK             0xC4
509 #define UX_HOST_CLASS_HID_CONSUMER_RETURN_TO_MARK               0xC5
510 #define UX_HOST_CLASS_HID_CONSUMER_SEARCH_MARK_FORWARD          0xC6
511 #define UX_HOST_CLASS_HID_CONSUMER_SEARCH_MARK_BACKWARDS        0xC7
512 #define UX_HOST_CLASS_HID_CONSUMER_COUNTER_RESET                0xC8
513 #define UX_HOST_CLASS_HID_CONSUMER_SHOW_COUNTER                 0xC9
514 #define UX_HOST_CLASS_HID_CONSUMER_TRACKING_INCREMENT           0xCA
515 #define UX_HOST_CLASS_HID_CONSUMER_TRACKING_DECREMENT           0xCB
516 #define UX_HOST_CLASS_HID_CONSUMER_STOP_EJECT                   0xCC
517 #define UX_HOST_CLASS_HID_CONSUMER_PLAY_PAUSE                   0xCD
518 #define UX_HOST_CLASS_HID_CONSUMER_PLAY_SKIP                    0xCE
519 #define UX_HOST_CLASS_HID_CONSUMER_VOLUME                       0xE0
520 #define UX_HOST_CLASS_HID_CONSUMER_BALANCE                      0xE1
521 #define UX_HOST_CLASS_HID_CONSUMER_MUTE                         0xE2
522 #define UX_HOST_CLASS_HID_CONSUMER_BASS                         0xE3
523 #define UX_HOST_CLASS_HID_CONSUMER_TREBLE                       0xE4
524 #define UX_HOST_CLASS_HID_CONSUMER_BASS_BOOST                   0xE5
525 #define UX_HOST_CLASS_HID_CONSUMER_SURROUND_MODE                0xE6
526 #define UX_HOST_CLASS_HID_CONSUMER_LOUDNESS                     0xE7
527 #define UX_HOST_CLASS_HID_CONSUMER_MPX                          0xE8
528 #define UX_HOST_CLASS_HID_CONSUMER_VOLUME_INCREMENT             0xE9
529 #define UX_HOST_CLASS_HID_CONSUMER_VOLUME_DECREMENT             0xEA
530 #define UX_HOST_CLASS_HID_CONSUMER_SPEED_SELECT                 0xF0
531 #define UX_HOST_CLASS_HID_CONSUMER_PLAYBACK_SPEED               0xF1
532 #define UX_HOST_CLASS_HID_CONSUMER_STANDARD_PLAY                0xF2
533 #define UX_HOST_CLASS_HID_CONSUMER_LONG_PLAY                    0xF3
534 #define UX_HOST_CLASS_HID_CONSUMER_EXTENDED_PLAY                0xF4
535 #define UX_HOST_CLASS_HID_CONSUMER_SLOW                         0xF5
536 #define UX_HOST_CLASS_HID_CONSUMER_FAN_ENABLE                   0xF6
537 #define UX_HOST_CLASS_HID_CONSUMER_FAN_SPEED                    0x100
538 #define UX_HOST_CLASS_HID_CONSUMER_LIGHT_ENABLE                 0x101
539 #define UX_HOST_CLASS_HID_CONSUMER_LIGHT_ILLUMINATION_LEVEL     0x102
540 #define UX_HOST_CLASS_HID_CONSUMER_CLIMATE_CONTROL_ENABLE       0x103
541 #define UX_HOST_CLASS_HID_CONSUMER_ROOM_TEMPERATURE             0x104
542 #define UX_HOST_CLASS_HID_CONSUMER_SECURITY_ENABLE              0x105
543 #define UX_HOST_CLASS_HID_CONSUMER_FIRE_ALARM                   0x106
544 #define UX_HOST_CLASS_HID_CONSUMER_POLICE_ALARM                 0x107
545 #define UX_HOST_CLASS_HID_CONSUMER_PROXIMITY                    0x108
546 #define UX_HOST_CLASS_HID_CONSUMER_MOTION                       0x109
547 #define UX_HOST_CLASS_HID_CONSUMER_DURESS_ALARM                 0x10A
548 #define UX_HOST_CLASS_HID_CONSUMER_HOLDUP_ALARM                 0x10B
549 #define UX_HOST_CLASS_HID_CONSUMER_MEDICAL_ALARM                0x10C
550 #define UX_HOST_CLASS_HID_CONSUMER_BALANCE_RIGHT                0x10D
551 #define UX_HOST_CLASS_HID_CONSUMER_BALANCE_LEFT                 0x150
552 #define UX_HOST_CLASS_HID_CONSUMER_BASS_INCREMENT               0x151
553 #define UX_HOST_CLASS_HID_CONSUMER_BASS_DECREMENT               0x152
554 #define UX_HOST_CLASS_HID_CONSUMER_TREBLE_INCREMENT             0x153
555 #define UX_HOST_CLASS_HID_CONSUMER_TREBLE_DECREMENT             0x154
556 #define UX_HOST_CLASS_HID_CONSUMER_SPEAKER_SYSTEM               0x155
557 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_LEFT                 0x160
558 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_RIGHT                0x161
559 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_CENTER               0x162
560 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_FRONT                0x163
561 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_CENTER_FRONT         0x164
562 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_SIDE                 0x165
563 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_SURROUND             0x166
564 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_LOW_FREQUENCY        0x167
565 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_TOP                  0x168
566 #define UX_HOST_CLASS_HID_CONSUMER_CHANNEL_UNKNOWN              0x169
567 #define UX_HOST_CLASS_HID_CONSUMER_SUB_CHANNEL                  0x16A
568 #define UX_HOST_CLASS_HID_CONSUMER_SUB_CHANNEL_INCREMENT        0x170
569 #define UX_HOST_CLASS_HID_CONSUMER_SUB_CHANNEL_DECREMENT        0x171
570 #define UX_HOST_CLASS_HID_CONSUMER_ALTERNATE_AUDIO_INCREMENT    0x172
571 #define UX_HOST_CLASS_HID_CONSUMER_ALTERNATE_AUDIO_DECREMENT    0x173
572 #define UX_HOST_CLASS_HID_CONSUMER_APPLICATION_LAUNCH_BUTTONS   0x174
573 #define UX_HOST_CLASS_HID_CONSUMER_AL_LAUNCH_BUTTON_CONFIGURATION 0x180
574 #define UX_HOST_CLASS_HID_CONSUMER_AL_PROGRAMMABLE_BUTTON       0x181
575 #define UX_HOST_CLASS_HID_CONSUMER_AL_CONSUMER_CONTROL_CONFIGURATION 0x182
576 #define UX_HOST_CLASS_HID_CONSUMER_AL_WORD_PROCESSOR            0x183
577 #define UX_HOST_CLASS_HID_CONSUMER_AL_TEXT_EDITOR               0x184
578 #define UX_HOST_CLASS_HID_CONSUMER_AL_SPREADSHEET               0x185
579 #define UX_HOST_CLASS_HID_CONSUMER_AL_GRAPHICS_EDITOR           0x186
580 #define UX_HOST_CLASS_HID_CONSUMER_AL_PRESENTATION_APP          0x187
581 #define UX_HOST_CLASS_HID_CONSUMER_AL_DATABASE_APP              0x188
582 #define UX_HOST_CLASS_HID_CONSUMER_AL_EMAIL_READER              0x189
583 #define UX_HOST_CLASS_HID_CONSUMER_AL_NEWSREADER                0x18A
584 #define UX_HOST_CLASS_HID_CONSUMER_AL_VOICEMAIL                 0x18B
585 #define UX_HOST_CLASS_HID_CONSUMER_AL_CONTACTS_ADDRESS_BOOK     0x18C
586 #define UX_HOST_CLASS_HID_CONSUMER_AL_CALENDAR_SCHEDULE         0x18D
587 #define UX_HOST_CLASS_HID_CONSUMER_AL_TASK_PROJECT_MANAGER      0x18E
588 #define UX_HOST_CLASS_HID_CONSUMER_AL_LOG_JOURNAL_TIMECARD      0x18F
589 #define UX_HOST_CLASS_HID_CONSUMER_AL_CHECKBOOK_FINANCE         0x190
590 #define UX_HOST_CLASS_HID_CONSUMER_AL_CALCULATOR                0x191
591 #define UX_HOST_CLASS_HID_CONSUMER_AL_A_V_CAPTURE_PLAYBACK      0x192
592 #define UX_HOST_CLASS_HID_CONSUMER_AL_LOCAL_MACHINE_BROWSER     0x193
593 #define UX_HOST_CLASS_HID_CONSUMER_AL_LAN_WAN_BROWSER           0x194
594 #define UX_HOST_CLASS_HID_CONSUMER_AL_INTERNET_BROWSER          0x195
595 #define UX_HOST_CLASS_HID_CONSUMER_AL_REMOTE_NETWORKING         0x196
596 #define UX_HOST_CLASS_HID_CONSUMER_AL_NETWORK_CONFERENCE        0x197
597 #define UX_HOST_CLASS_HID_CONSUMER_AL_NETWORK_CHAT              0x198
598 #define UX_HOST_CLASS_HID_CONSUMER_AL_TELEPHONY_DIALER          0x199
599 #define UX_HOST_CLASS_HID_CONSUMER_AL_LOGON                     0x19A
600 #define UX_HOST_CLASS_HID_CONSUMER_AL_LOGOFF                    0x19B
601 #define UX_HOST_CLASS_HID_CONSUMER_AL_LOGON_LOGOFF              0x19C
602 #define UX_HOST_CLASS_HID_CONSUMER_AL_SCREENSAVER               0x19D
603 #define UX_HOST_CLASS_HID_CONSUMER_AL_CONTROL_PANEL             0x19E
604 #define UX_HOST_CLASS_HID_CONSUMER_AL_COMMAND_LINE_PROCESSOR    0x19F
605 #define UX_HOST_CLASS_HID_CONSUMER_AL_PROCESS_MANAGER           0x1A0
606 #define UX_HOST_CLASS_HID_CONSUMER_AL_SELECT_APPLICATION        0x1A1
607 #define UX_HOST_CLASS_HID_CONSUMER_AL_NEXT_APPLICATION          0x1A2
608 #define UX_HOST_CLASS_HID_CONSUMER_AL_PREVIOUS_APPLICATION      0x1A3
609 #define UX_HOST_CLASS_HID_CONSUMER_AL_PREEMPTIVE_HALT_APPLICATION 0x1A4
610 #define UX_HOST_CLASS_HID_CONSUMER_AL_INTEGRATED_HELP_CENTER    0x1A5
611 #define UX_HOST_CLASS_HID_CONSUMER_AL_DOCUMENTS                 0x1A6
612 #define UX_HOST_CLASS_HID_CONSUMER_AL_THESAURUS                 0x1A7
613 #define UX_HOST_CLASS_HID_CONSUMER_AL_DICTIONARY                0x1A8
614 #define UX_HOST_CLASS_HID_CONSUMER_AL_DESKTOP                   0x1A9
615 #define UX_HOST_CLASS_HID_CONSUMER_AL_SPELL_CHECK               0x1AA
616 #define UX_HOST_CLASS_HID_CONSUMER_AL_GRAMMAR_CHECK             0x1AB
617 #define UX_HOST_CLASS_HID_CONSUMER_AL_WIRELESS_STATUS           0x1AC
618 #define UX_HOST_CLASS_HID_CONSUMER_AL_KEYBOARD_LAYOUT           0x1AD
619 #define UX_HOST_CLASS_HID_CONSUMER_AL_VIRUS_PROTECTION          0x1AE
620 #define UX_HOST_CLASS_HID_CONSUMER_AL_ENCRYPTION                0x1AF
621 #define UX_HOST_CLASS_HID_CONSUMER_AL_SCREEN_SAVER              0x1B0
622 #define UX_HOST_CLASS_HID_CONSUMER_AL_ALARMS                    0x1B1
623 #define UX_HOST_CLASS_HID_CONSUMER_AL_CLOCK                     0x1B2
624 #define UX_HOST_CLASS_HID_CONSUMER_AL_FILE_BROWSER              0x1B3
625 #define UX_HOST_CLASS_HID_CONSUMER_AL_POWER_STATUS              0x1B4
626 #define UX_HOST_CLASS_HID_CONSUMER_AC_NEW                       0x1B5
627 #define UX_HOST_CLASS_HID_CONSUMER_AC_OPEN                      0x201
628 #define UX_HOST_CLASS_HID_CONSUMER_AC_CLOSE                     0x202
629 #define UX_HOST_CLASS_HID_CONSUMER_AC_EXIT                      0x203
630 #define UX_HOST_CLASS_HID_CONSUMER_AC_MAXIMIZE                  0x204
631 #define UX_HOST_CLASS_HID_CONSUMER_AC_MINIMIZE                  0x205
632 #define UX_HOST_CLASS_HID_CONSUMER_AC_SAVE                      0x206
633 #define UX_HOST_CLASS_HID_CONSUMER_AC_PRINT                     0x207
634 #define UX_HOST_CLASS_HID_CONSUMER_AC_PROPERTIES                0x208
635 #define UX_HOST_CLASS_HID_CONSUMER_AC_UNDO                      0x209
636 #define UX_HOST_CLASS_HID_CONSUMER_AC_COPY                      0x21A
637 #define UX_HOST_CLASS_HID_CONSUMER_AC_CUT                       0x21B
638 #define UX_HOST_CLASS_HID_CONSUMER_AC_PASTE                     0x21C
639 #define UX_HOST_CLASS_HID_CONSUMER_AC_SELECT_ALL                0x21D
640 #define UX_HOST_CLASS_HID_CONSUMER_AC_FIND                      0x21E
641 #define UX_HOST_CLASS_HID_CONSUMER_AC_FIND_AND_REPLACE          0x21F
642 #define UX_HOST_CLASS_HID_CONSUMER_AC_SEARCH                    0x220
643 #define UX_HOST_CLASS_HID_CONSUMER_AC_GO_TO                     0x221
644 #define UX_HOST_CLASS_HID_CONSUMER_AC_HOME                      0x222
645 #define UX_HOST_CLASS_HID_CONSUMER_AC_BACK                      0x223
646 #define UX_HOST_CLASS_HID_CONSUMER_AC_FORWARD                   0x224
647 #define UX_HOST_CLASS_HID_CONSUMER_AC_STOP                      0x225
648 #define UX_HOST_CLASS_HID_CONSUMER_AC_REFRESH                   0x226
649 #define UX_HOST_CLASS_HID_CONSUMER_AC_PREVIOUS_LINK             0x227
650 #define UX_HOST_CLASS_HID_CONSUMER_AC_NEXT_LINK                 0x228
651 #define UX_HOST_CLASS_HID_CONSUMER_AC_BOOKMARKS                 0x229
652 #define UX_HOST_CLASS_HID_CONSUMER_AC_HISTORY                   0x22A
653 #define UX_HOST_CLASS_HID_CONSUMER_AC_SUBSCRIPTIONS             0x22B
654 #define UX_HOST_CLASS_HID_CONSUMER_AC_ZOOM_IN                   0x22C
655 #define UX_HOST_CLASS_HID_CONSUMER_AC_ZOOM_OUT                  0x22D
656 #define UX_HOST_CLASS_HID_CONSUMER_AC_ZOOM                      0x22E
657 #define UX_HOST_CLASS_HID_CONSUMER_AC_FULL_SCREEN_VIEW          0x22F
658 #define UX_HOST_CLASS_HID_CONSUMER_AC_NORMAL_VIEW               0x230
659 #define UX_HOST_CLASS_HID_CONSUMER_AC_VIEW_TOGGLE               0x231
660 #define UX_HOST_CLASS_HID_CONSUMER_AC_SCROLL_UP                 0x232
661 #define UX_HOST_CLASS_HID_CONSUMER_AC_SCROLL_DOWN               0x233
662 #define UX_HOST_CLASS_HID_CONSUMER_AC_SCROLL                    0x234
663 #define UX_HOST_CLASS_HID_CONSUMER_AC_PAN_LEFT                  0x235
664 #define UX_HOST_CLASS_HID_CONSUMER_AC_PAN_RIGHT                 0x236
665 #define UX_HOST_CLASS_HID_CONSUMER_AC_PAN                       0x237
666 #define UX_HOST_CLASS_HID_CONSUMER_AC_NEW_WINDOW                0x238
667 #define UX_HOST_CLASS_HID_CONSUMER_AC_TILE_HORIZONTALLY         0x239
668 #define UX_HOST_CLASS_HID_CONSUMER_AC_TILE_VERTICALLY           0x23A
669 #define UX_HOST_CLASS_HID_CONSUMER_AC_FORMAT                    0x23B
670 #define UX_HOST_CLASS_HID_CONSUMER_AC_EDIT                      0x23C
671 #define UX_HOST_CLASS_HID_CONSUMER_AC_BOLD                      0x23D
672 #define UX_HOST_CLASS_HID_CONSUMER_AC_ITALICS                   0x23E
673 #define UX_HOST_CLASS_HID_CONSUMER_AC_UNDERLINE                 0x23F
674 #define UX_HOST_CLASS_HID_CONSUMER_AC_STRIKETHROUGH             0x240
675 #define UX_HOST_CLASS_HID_CONSUMER_AC_SUBSCRIPT                 0x241
676 #define UX_HOST_CLASS_HID_CONSUMER_AC_SUPERSCRIPT               0x242
677 #define UX_HOST_CLASS_HID_CONSUMER_AC_ALL_CAPS                  0x243
678 #define UX_HOST_CLASS_HID_CONSUMER_AC_ROTATE                    0x244
679 #define UX_HOST_CLASS_HID_CONSUMER_AC_RESIZE                    0x245
680 #define UX_HOST_CLASS_HID_CONSUMER_AC_FLIP_HORIZONTAL           0x246
681 #define UX_HOST_CLASS_HID_CONSUMER_AC_FLIP_VERTICAL             0x247
682 #define UX_HOST_CLASS_HID_CONSUMER_AC_MIRROR_HORIZONTAL         0x248
683 #define UX_HOST_CLASS_HID_CONSUMER_AC_MIRROR_VERTICAL           0x249
684 #define UX_HOST_CLASS_HID_CONSUMER_AC_FONT_SELECT               0x24A
685 #define UX_HOST_CLASS_HID_CONSUMER_AC_FONT_COLOR                0x24B
686 #define UX_HOST_CLASS_HID_CONSUMER_AC_FONT_SIZE                 0x24C
687 #define UX_HOST_CLASS_HID_CONSUMER_AC_JUSTIFY_LEFT              0x24D
688 #define UX_HOST_CLASS_HID_CONSUMER_AC_JUSTIFY_CENTER_H          0x24E
689 #define UX_HOST_CLASS_HID_CONSUMER_AC_JUSTIFY_RIGHT             0x24F
690 #define UX_HOST_CLASS_HID_CONSUMER_AC_JUSTIFY_BLOCK_H           0x250
691 #define UX_HOST_CLASS_HID_CONSUMER_AC_JUSTIFY_TOP               0x251
692 #define UX_HOST_CLASS_HID_CONSUMER_AC_JUSTIFY_CENTER_V          0x252
693 #define UX_HOST_CLASS_HID_CONSUMER_AC_JUSTIFY_BOTTOM            0x253
694 #define UX_HOST_CLASS_HID_CONSUMER_AC_JUSTIFY_BLOCK_V           0x254
695 #define UX_HOST_CLASS_HID_CONSUMER_AC_INDENT_DECREASE           0x255
696 #define UX_HOST_CLASS_HID_CONSUMER_AC_INDENT_INCREASE           0x256
697 #define UX_HOST_CLASS_HID_CONSUMER_AC_NUMBERED_LIST             0x257
698 #define UX_HOST_CLASS_HID_CONSUMER_AC_RESTART_NUMBERING         0x258
699 #define UX_HOST_CLASS_HID_CONSUMER_AC_BULLETED_LIST             0x259
700 #define UX_HOST_CLASS_HID_CONSUMER_AC_PROMOTE                   0x25A
701 #define UX_HOST_CLASS_HID_CONSUMER_AC_DEMOTE                    0x25B
702 #define UX_HOST_CLASS_HID_CONSUMER_AC_YES                       0x25C
703 #define UX_HOST_CLASS_HID_CONSUMER_AC_NO                        0x25D
704 #define UX_HOST_CLASS_HID_CONSUMER_AC_CANCEL                    0x25E
705 #define UX_HOST_CLASS_HID_CONSUMER_AC_CATALOG                   0x25F
706 #define UX_HOST_CLASS_HID_CONSUMER_AC_BUY_CHECKOUT              0x260
707 #define UX_HOST_CLASS_HID_CONSUMER_AC_ADD_TO_CART               0x261
708 #define UX_HOST_CLASS_HID_CONSUMER_AC_EXPAND                    0x262
709 #define UX_HOST_CLASS_HID_CONSUMER_AC_EXPAND_ALL                0x263
710 #define UX_HOST_CLASS_HID_CONSUMER_AC_COLLAPSE                  0x264
711 #define UX_HOST_CLASS_HID_CONSUMER_AC_COLLAPSE_ALL              0x265
712 #define UX_HOST_CLASS_HID_CONSUMER_AC_PRINT_PREVIEW             0x266
713 #define UX_HOST_CLASS_HID_CONSUMER_AC_PASTE_SPECIAL             0x267
714 #define UX_HOST_CLASS_HID_CONSUMER_AC_INSERT_MODE               0x268
715 #define UX_HOST_CLASS_HID_CONSUMER_AC_DELETE                    0x269
716 #define UX_HOST_CLASS_HID_CONSUMER_AC_LOCK                      0x26A
717 #define UX_HOST_CLASS_HID_CONSUMER_AC_UNLOCK                    0x26B
718 #define UX_HOST_CLASS_HID_CONSUMER_AC_PROTECT                   0x26C
719 #define UX_HOST_CLASS_HID_CONSUMER_AC_UNPROTECT                 0x26D
720 #define UX_HOST_CLASS_HID_CONSUMER_AC_ATTACH_COMMENT            0x26E
721 #define UX_HOST_CLASS_HID_CONSUMER_AC_DELETE_COMMENT            0x26F
722 #define UX_HOST_CLASS_HID_CONSUMER_AC_VIEW_COMMENT              0x270
723 #define UX_HOST_CLASS_HID_CONSUMER_AC_SELECT_WORD               0x271
724 #define UX_HOST_CLASS_HID_CONSUMER_AC_SELECT_SENTENCE           0x272
725 #define UX_HOST_CLASS_HID_CONSUMER_AC_SELECT_PARAGRAPH          0x273
726 #define UX_HOST_CLASS_HID_CONSUMER_AC_SELECT_COLUMN             0x274
727 #define UX_HOST_CLASS_HID_CONSUMER_AC_SELECT_ROW                0x275
728 #define UX_HOST_CLASS_HID_CONSUMER_AC_SELECT_TABLE              0x276
729 #define UX_HOST_CLASS_HID_CONSUMER_AC_SELECT_OBJECT             0x277
730 #define UX_HOST_CLASS_HID_CONSUMER_AC_REDO_REPEAT               0x278
731 #define UX_HOST_CLASS_HID_CONSUMER_AC_SORT                      0x279
732 #define UX_HOST_CLASS_HID_CONSUMER_AC_SORT_ASCENDING            0x27A
733 #define UX_HOST_CLASS_HID_CONSUMER_AC_SORT_DESCENDING           0x27B
734 #define UX_HOST_CLASS_HID_CONSUMER_AC_FILTER                    0x27C
735 #define UX_HOST_CLASS_HID_CONSUMER_AC_SET_CLOCK                 0x27D
736 #define UX_HOST_CLASS_HID_CONSUMER_AC_VIEW_CLOCK                0x27E
737 #define UX_HOST_CLASS_HID_CONSUMER_AC_SELECT_TIME_ZONE          0x27F
738 #define UX_HOST_CLASS_HID_CONSUMER_AC_EDIT_TIME_ZONES           0x280
739 #define UX_HOST_CLASS_HID_CONSUMER_AC_SET_ALARM                 0x281
740 #define UX_HOST_CLASS_HID_CONSUMER_AC_CLEAR_ALARM               0x282
741 #define UX_HOST_CLASS_HID_CONSUMER_AC_SNOOZE_ALARM              0x283
742 #define UX_HOST_CLASS_HID_CONSUMER_AC_RESET_ALARM               0x284
743 #define UX_HOST_CLASS_HID_CONSUMER_AC_SYNCHRONIZE               0x285
744 #define UX_HOST_CLASS_HID_CONSUMER_AC_SEND_RECEIVE              0x286
745 #define UX_HOST_CLASS_HID_CONSUMER_AC_SEND_TO                   0x287
746 #define UX_HOST_CLASS_HID_CONSUMER_AC_REPLY                     0x288
747 #define UX_HOST_CLASS_HID_CONSUMER_AC_REPLY_ALL                 0x289
748 #define UX_HOST_CLASS_HID_CONSUMER_AC_FORWARD_MSG               0x28A
749 #define UX_HOST_CLASS_HID_CONSUMER_AC_SEND                      0x28B
750 #define UX_HOST_CLASS_HID_CONSUMER_AC_ATTACH_FILE               0x28C
751 #define UX_HOST_CLASS_HID_CONSUMER_AC_UPLOAD                    0x28D
752 #define UX_HOST_CLASS_HID_CONSUMER_AC_DOWNLOAD                  0x28E
753 #define UX_HOST_CLASS_HID_CONSUMER_AC_SET_BORDERS               0x28F
754 #define UX_HOST_CLASS_HID_CONSUMER_AC_INSERT_ROW                0x290
755 #define UX_HOST_CLASS_HID_CONSUMER_AC_INSERT_COLUMN             0x291
756 #define UX_HOST_CLASS_HID_CONSUMER_AC_INSERT_FILE               0x292
757 #define UX_HOST_CLASS_HID_CONSUMER_AC_INSERT_PICTURE            0x293
758 #define UX_HOST_CLASS_HID_CONSUMER_AC_INSERT_OBJECT             0x294
759 #define UX_HOST_CLASS_HID_CONSUMER_AC_INSERT_SYMBOL             0x295
760 #define UX_HOST_CLASS_HID_CONSUMER_AC_SAVE_CLOSE                0x296
761 #define UX_HOST_CLASS_HID_CONSUMER_AC_RENAME                    0x297
762 #define UX_HOST_CLASS_HID_CONSUMER_AC_MERGE                     0x298
763 #define UX_HOST_CLASS_HID_CONSUMER_AC_SPLIT                     0x299
764 #define UX_HOST_CLASS_HID_CONSUMER_AC_DISRIBUTE_HORIZONTALLY    0x29A
765 #define UX_HOST_CLASS_HID_CONSUMER_AC_DISTRIBUTE_VERTICALLY     0x29B
766 
767 /* Define HID Report Types.  */
768 
769 #define UX_HOST_CLASS_HID_REPORT_TYPE_INPUT                     0x1
770 #define UX_HOST_CLASS_HID_REPORT_TYPE_OUTPUT                    0x2
771 #define UX_HOST_CLASS_HID_REPORT_TYPE_FEATURE                   0x3
772 
773 /* Define HID Class report callback structure.  */
774 
775 #ifndef UX_HOST_CLASS_HID_USAGES
776 #define UX_HOST_CLASS_HID_USAGES                                1024
777 #endif
778 
779 #define UX_HOST_CLASS_HID_MAX_GLOBAL                            4
780 #define UX_HOST_CLASS_HID_MAX_COLLECTION                        4
781 
782 /* Define HID flags.  */
783 #define UX_HOST_CLASS_HID_FLAG_LOCK                             1ul
784 #define UX_HOST_CLASS_HID_FLAG_PROTECT                          2ul
785 
786 #ifndef UX_HOST_CLASS_HID_REPORT_TRANSFER_TIMEOUT
787 #define UX_HOST_CLASS_HID_REPORT_TRANSFER_TIMEOUT               10000
788 #endif
789 
790 /* Define HID Class descriptor.  */
791 
792 typedef struct UX_HID_DESCRIPTOR_STRUCT
793 {
794 
795     UCHAR           bLength;
796     UCHAR           bDescriptorType;
797     USHORT          bcdHID;
798     UCHAR           bCountryCode;
799     UCHAR           bNumDescriptor;
800     UCHAR           bReportDescriptorType;
801     UCHAR           _align_wItemLength[1];
802     USHORT          wItemLength;
803     UCHAR           _align_size[2];
804 } UX_HID_DESCRIPTOR;
805 
806 
807 typedef struct UX_HOST_CLASS_HID_REPORT_CALLBACK_STRUCT
808 {
809 
810     struct UX_HOST_CLASS_HID_CLIENT_STRUCT
811                     *ux_host_class_hid_report_callback_client;
812     ULONG           ux_host_class_hid_report_callback_id;
813     ULONG           ux_host_class_hid_report_callback_status;
814     ULONG           ux_host_class_hid_report_callback_flags;
815     ULONG           ux_host_class_hid_report_callback_value;
816     ULONG           ux_host_class_hid_report_callback_usage;
817     ULONG           ux_host_class_hid_report_callback_length;
818     ULONG           ux_host_class_hid_report_callback_actual_length;
819     VOID            *ux_host_class_hid_report_callback_buffer;
820     VOID            (*ux_host_class_hid_report_callback_function) (struct UX_HOST_CLASS_HID_REPORT_CALLBACK_STRUCT *);
821 } UX_HOST_CLASS_HID_REPORT_CALLBACK;
822 
823 
824 
825 typedef struct UX_HOST_CLASS_HID_REPORT_GET_ID_STRUCT
826 {
827 
828     ULONG           ux_host_class_hid_report_get_id;
829     ULONG           ux_host_class_hid_report_get_type;
830     struct UX_HOST_CLASS_HID_REPORT_STRUCT
831                     *ux_host_class_hid_report_get_report;
832 } UX_HOST_CLASS_HID_REPORT_GET_ID;
833 
834 
835 /* Define HID Class local item structure.  */
836 
837 typedef struct UX_HOST_CLASS_HID_LOCAL_ITEM_STRUCT
838 {
839 
840     ULONG           ux_host_class_hid_local_item_usages[UX_HOST_CLASS_HID_USAGES];
841     ULONG           ux_host_class_hid_local_item_number_usage;
842     ULONG           ux_host_class_hid_local_item_usage_min;
843     ULONG           ux_host_class_hid_local_item_usage_max;
844     ULONG           ux_host_class_hid_local_item_delimiter_level;
845     ULONG           ux_host_class_hid_local_item_delimiter_branch;
846 } UX_HOST_CLASS_HID_LOCAL_ITEM;
847 
848 
849 /* Define HID Class global item structure.  */
850 
851 typedef struct UX_HOST_CLASS_HID_GLOBAL_ITEM_STRUCT
852 {
853 
854     ULONG           ux_host_class_hid_global_item_usage_page;
855     SLONG           ux_host_class_hid_global_item_logical_min;
856     SLONG           ux_host_class_hid_global_item_logical_max;
857     SLONG           ux_host_class_hid_global_item_physical_min;
858     SLONG           ux_host_class_hid_global_item_physical_max;
859     ULONG           ux_host_class_hid_global_item_unit_expo;
860     ULONG           ux_host_class_hid_global_item_unit;
861     ULONG           ux_host_class_hid_global_item_report_size;
862     ULONG           ux_host_class_hid_global_item_report_id;
863     ULONG           ux_host_class_hid_global_item_report_count;
864 } UX_HOST_CLASS_HID_GLOBAL_ITEM;
865 
866 
867 /* Define HID Class field structure.  */
868 
869 typedef struct UX_HOST_CLASS_HID_FIELD_STRUCT
870 {
871 
872     ULONG           ux_host_class_hid_field_physical;
873     ULONG           ux_host_class_hid_field_logical;
874     ULONG           ux_host_class_hid_field_application;
875     ULONG           ux_host_class_hid_field_usage_page;
876     ULONG           ux_host_class_hid_field_usage_min;
877     ULONG           ux_host_class_hid_field_usage_max;
878     SLONG           ux_host_class_hid_field_logical_min;
879     SLONG           ux_host_class_hid_field_logical_max;
880     SLONG           ux_host_class_hid_field_physical_min;
881     SLONG           ux_host_class_hid_field_physical_max;
882     ULONG           ux_host_class_hid_field_unit;
883     ULONG           ux_host_class_hid_field_unit_expo;
884     ULONG           ux_host_class_hid_field_report_type;
885     ULONG           ux_host_class_hid_field_report_id;
886     ULONG           ux_host_class_hid_field_report_offset;
887     ULONG           ux_host_class_hid_field_report_size;
888     ULONG           ux_host_class_hid_field_report_count;
889     ULONG           ux_host_class_hid_field_value;
890     ULONG           *ux_host_class_hid_field_usages;
891     ULONG           ux_host_class_hid_field_number_usage;
892     ULONG           *ux_host_class_hid_field_values;
893     ULONG           ux_host_class_hid_field_number_values;
894     struct UX_HOST_CLASS_HID_REPORT_STRUCT
895                     *ux_host_class_hid_field_report;
896     struct UX_HOST_CLASS_HID_FIELD_STRUCT
897                     *ux_host_class_hid_field_next_field;
898 } UX_HOST_CLASS_HID_FIELD;
899 
900 
901 /* Define HID Class report structure.  */
902 
903 typedef struct UX_HOST_CLASS_HID_REPORT_STRUCT
904 {
905 
906     ULONG           ux_host_class_hid_report_id;
907     ULONG           ux_host_class_hid_report_type;
908     struct UX_HOST_CLASS_HID_FIELD_STRUCT
909                     *ux_host_class_hid_report_field;
910     ULONG           ux_host_class_hid_report_number_item;
911     ULONG           ux_host_class_hid_report_byte_length;
912     ULONG           ux_host_class_hid_report_bit_length;
913     ULONG           ux_host_class_hid_report_callback_flags;
914     VOID            *ux_host_class_hid_report_callback_buffer;
915     ULONG           ux_host_class_hid_report_callback_length;
916     VOID            (*ux_host_class_hid_report_callback_function) (struct UX_HOST_CLASS_HID_REPORT_CALLBACK_STRUCT *);
917     struct UX_HOST_CLASS_HID_REPORT_STRUCT
918                     *ux_host_class_hid_report_next_report;
919 } UX_HOST_CLASS_HID_REPORT;
920 
921 
922 /* Define HID main parser structure.  */
923 
924 typedef struct UX_HOST_CLASS_HID_PARSER_STRUCT
925 {
926 
927     UX_HOST_CLASS_HID_GLOBAL_ITEM
928                     ux_host_class_hid_parser_global;
929     UX_HOST_CLASS_HID_GLOBAL_ITEM
930                     ux_host_class_hid_parser_global_pool[UX_HOST_CLASS_HID_MAX_GLOBAL];
931     ULONG           ux_host_class_hid_parser_number_global;
932     UX_HOST_CLASS_HID_LOCAL_ITEM
933                     ux_host_class_hid_parser_local;
934     ULONG           ux_host_class_hid_parser_application;
935     ULONG           ux_host_class_hid_parser_collection[UX_HOST_CLASS_HID_MAX_COLLECTION];
936     ULONG           ux_host_class_hid_parser_number_collection;
937     ULONG           ux_host_class_hid_parser_main_page;
938     ULONG           ux_host_class_hid_parser_main_usage;
939     UX_HOST_CLASS_HID_REPORT
940                     *ux_host_class_hid_parser_input_report;
941     UX_HOST_CLASS_HID_REPORT
942                     *ux_host_class_hid_parser_output_report;
943     UX_HOST_CLASS_HID_REPORT
944                     *ux_host_class_hid_parser_feature_report;
945 } UX_HOST_CLASS_HID_PARSER;
946 
947 
948 /* Define HID Class item analysis structure.  */
949 
950 typedef struct UX_HOST_CLASS_HID_ITEM_STRUCT
951 {
952 
953     UCHAR           ux_host_class_hid_item_report_type;
954     UCHAR           ux_host_class_hid_item_report_tag;
955     USHORT          ux_host_class_hid_item_report_length;
956     USHORT          ux_host_class_hid_item_report_format;
957 }  UX_HOST_CLASS_HID_ITEM;
958 
959 
960 /* Define HID Class instance structure.  */
961 
962 typedef struct UX_HOST_CLASS_HID_STRUCT
963 {
964 
965     struct UX_HOST_CLASS_HID_STRUCT
966                     *ux_host_class_hid_next_instance;
967     UX_HOST_CLASS   *ux_host_class_hid_class;
968     UX_DEVICE       *ux_host_class_hid_device;
969     UX_ENDPOINT     *ux_host_class_hid_interrupt_endpoint;
970 #if defined(UX_HOST_CLASS_HID_INTERRUPT_OUT_SUPPORT)
971     UX_ENDPOINT     *ux_host_class_hid_interrupt_out_endpoint;
972 #endif
973     UINT            ux_host_class_hid_interrupt_endpoint_status;
974     UX_INTERFACE    *ux_host_class_hid_interface;
975     ULONG           ux_host_class_hid_state;
976     struct UX_HID_DESCRIPTOR_STRUCT
977                     ux_host_class_hid_descriptor;
978     UX_HOST_CLASS_HID_PARSER
979                     ux_host_class_hid_parser;
980     struct UX_HOST_CLASS_HID_CLIENT_STRUCT
981                     *ux_host_class_hid_client;
982 #if !defined(UX_HOST_STANDALONE)
983     UX_SEMAPHORE    ux_host_class_hid_semaphore;
984 #else
985     ULONG           ux_host_class_hid_flags;
986     UCHAR           *ux_host_class_hid_allocated;
987     UINT            ux_host_class_hid_status;
988     UCHAR           ux_host_class_hid_enum_state;
989     UCHAR           ux_host_class_hid_next_state;
990     UCHAR           ux_host_class_hid_cmd_state;
991     UCHAR           reserved[1];
992 #endif
993 } UX_HOST_CLASS_HID;
994 
995 #if defined(UX_HOST_STANDALONE)
996 #define _ux_host_class_hid_lock_fail_return(hid)                                \
997     UX_DISABLE                                                                  \
998     if (hid -> ux_host_class_hid_flags & UX_HOST_CLASS_HID_FLAG_LOCK)           \
999     {                                                                           \
1000         UX_RESTORE                                                              \
1001         status = UX_BUSY;                                                       \
1002         return(status);                                                         \
1003     }                                                                           \
1004     hid -> ux_host_class_hid_flags |= UX_HOST_CLASS_HID_FLAG_LOCK;              \
1005     UX_RESTORE
1006 #define _ux_host_class_hid_unlock(hid) do {                                     \
1007         hid -> ux_host_class_hid_flags &= ~UX_HOST_CLASS_HID_FLAG_LOCK;         \
1008     } while(0)
1009 #else
1010 #define _ux_host_class_hid_lock_fail_return(hid)                                \
1011     status =  _ux_host_semaphore_get(&hid -> ux_host_class_hid_semaphore,       \
1012                                     UX_WAIT_FOREVER);                           \
1013     if (status != UX_SUCCESS)                                                   \
1014         return(status);
1015 #define _ux_host_class_hid_unlock(hid)                                          \
1016     _ux_host_semaphore_put(&hid -> ux_host_class_hid_semaphore);
1017 #endif
1018 
1019 
1020 /* Define HID Class client command format structure.  */
1021 
1022 typedef struct UX_HOST_CLASS_HID_CLIENT_COMMAND_STRUCT
1023 {
1024 
1025     UINT            ux_host_class_hid_client_command_request;
1026     VOID            *ux_host_class_hid_client_command_container;
1027     UX_HOST_CLASS_HID    *ux_host_class_hid_client_command_instance;
1028     ULONG           ux_host_class_hid_client_command_page;
1029     ULONG           ux_host_class_hid_client_command_usage;
1030 } UX_HOST_CLASS_HID_CLIENT_COMMAND;
1031 
1032 
1033 /* Define HID Class report command structure.  */
1034 
1035 typedef struct UX_HOST_CLASS_HID_CLIENT_REPORT_STRUCT
1036 {
1037 
1038     UX_HOST_CLASS_HID_REPORT
1039                     *ux_host_class_hid_client_report;
1040     ULONG           *ux_host_class_hid_client_report_buffer;
1041     ULONG           ux_host_class_hid_client_report_length;
1042     ULONG           ux_host_class_hid_client_report_actual_length;
1043     UINT            ux_host_class_hid_client_report_flags;
1044 } UX_HOST_CLASS_HID_CLIENT_REPORT;
1045 
1046 
1047 /* Define HID Class client structure.  */
1048 
1049 typedef struct UX_HOST_CLASS_HID_CLIENT_STRUCT
1050 {
1051 
1052     ULONG           ux_host_class_hid_client_status;
1053 #if defined(UX_NAME_REFERENCED_BY_POINTER)
1054     UCHAR           *ux_host_class_hid_client_name;
1055 #else
1056     UCHAR           ux_host_class_hid_client_name[UX_HOST_CLASS_HID_MAX_CLIENT_NAME_LENGTH + 1]; /* "+1" for string null-terminator */
1057 #endif
1058     UINT            (*ux_host_class_hid_client_handler) (struct UX_HOST_CLASS_HID_CLIENT_COMMAND_STRUCT *);
1059     VOID            *ux_host_class_hid_client_local_instance;
1060 #if defined(UX_HOST_STANDALONE)
1061     VOID            (*ux_host_class_hid_client_function)(struct UX_HOST_CLASS_HID_CLIENT_STRUCT *);
1062 #endif
1063 } UX_HOST_CLASS_HID_CLIENT;
1064 
1065 /* Define HID Class function prototypes.  */
1066 
1067 UINT    _ux_host_class_hid_activate(UX_HOST_CLASS_COMMAND  *command);
1068 UINT    _ux_host_class_hid_client_register(UCHAR *hid_client_name,
1069                                 UINT (*hid_client_handler)(struct UX_HOST_CLASS_HID_CLIENT_COMMAND_STRUCT *));
1070 UINT    _ux_host_class_hid_client_search(UX_HOST_CLASS_HID *hid);
1071 UINT    _ux_host_class_hid_configure(UX_HOST_CLASS_HID *hid);
1072 UINT    _ux_host_class_hid_deactivate(UX_HOST_CLASS_COMMAND *command);
1073 UINT    _ux_host_class_hid_descriptor_parse(UX_HOST_CLASS_HID *hid);
1074 UINT    _ux_host_class_hid_entry(UX_HOST_CLASS_COMMAND *command);
1075 UINT    _ux_host_class_hid_field_decompress(UX_HOST_CLASS_HID_FIELD *hid_field, UCHAR *report_buffer, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
1076 UINT    _ux_host_class_hid_global_item_parse(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_ITEM *item, UCHAR *descriptor);
1077 UINT    _ux_host_class_hid_idle_get(UX_HOST_CLASS_HID *hid, USHORT *idle_time, USHORT report_id);
1078 UINT    _ux_host_class_hid_idle_set(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id);
1079 UINT    _ux_host_class_hid_instance_clean(UX_HOST_CLASS_HID *hid);
1080 UINT    _ux_host_class_hid_interrupt_endpoint_search(UX_HOST_CLASS_HID *hid);
1081 ULONG   _ux_host_class_hid_item_data_get(UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item);
1082 UINT    _ux_host_class_hid_local_item_parse(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_ITEM *item, UCHAR *descriptor);
1083 UINT    _ux_host_class_hid_main_item_parse(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_ITEM *item, UCHAR *descriptor);
1084 UINT    _ux_host_class_hid_periodic_report_start(UX_HOST_CLASS_HID *hid);
1085 UINT    _ux_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid);
1086 UINT    _ux_host_class_hid_report_add(UX_HOST_CLASS_HID *hid, UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item);
1087 UINT    _ux_host_class_hid_report_callback_register(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_CALLBACK *call_back);
1088 UINT    _ux_host_class_hid_report_compress(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report,
1089                                                     UCHAR *report_buffer, ULONG report_length);
1090 UINT    _ux_host_class_hid_report_decompress(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report,
1091                                                     UCHAR  *report_buffer, ULONG report_length);
1092 UINT    _ux_host_class_hid_report_descriptor_get(UX_HOST_CLASS_HID *hid, ULONG length);
1093 UINT    _ux_host_class_hid_report_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
1094 UINT    _ux_host_class_hid_report_id_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_GET_ID *report_id);
1095 UINT    _ux_host_class_hid_report_item_analyse(UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item);
1096 UINT    _ux_host_class_hid_report_set(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
1097 UINT    _ux_host_class_hid_resources_free(UX_HOST_CLASS_HID *hid);
1098 VOID    _ux_host_class_hid_transfer_request_completed(UX_TRANSFER *transfer_request);
1099 
1100 UINT    _ux_host_class_hid_tasks_run(UX_HOST_CLASS *hid_class);
1101 UINT    _ux_host_class_hid_idle_set_run(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id);
1102 UINT    _ux_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
1103 
1104 
1105 UINT    _uxe_host_class_hid_client_register(UCHAR *hid_client_name,
1106                                 UINT (*hid_client_handler)(struct UX_HOST_CLASS_HID_CLIENT_COMMAND_STRUCT *));
1107 
1108 UINT    _uxe_host_class_hid_idle_get(UX_HOST_CLASS_HID *hid, USHORT *idle_time, USHORT report_id);
1109 UINT    _uxe_host_class_hid_idle_set(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id);
1110 
1111 UINT    _uxe_host_class_hid_periodic_report_start(UX_HOST_CLASS_HID *hid);
1112 UINT    _uxe_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid);
1113 
1114 UINT    _uxe_host_class_hid_report_callback_register(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_CALLBACK *call_back);
1115 UINT    _uxe_host_class_hid_report_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
1116 UINT    _uxe_host_class_hid_report_id_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_GET_ID *report_id);
1117 UINT    _uxe_host_class_hid_report_set(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
1118 
1119 UINT    _uxe_host_class_hid_idle_set_run(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id);
1120 UINT    _uxe_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
1121 
1122 
1123 /* Define HID Class API prototypes.  */
1124 
1125 #define ux_host_class_hid_client_search                     _ux_host_class_hid_client_search
1126 
1127 #define ux_host_class_hid_descriptor_parse                  _ux_host_class_hid_descriptor_parse
1128 
1129 #define ux_host_class_hid_entry                             _ux_host_class_hid_entry
1130 
1131 #define ux_host_class_hid_report_add                        _ux_host_class_hid_report_add
1132 #define ux_host_class_hid_report_descriptor_get             _ux_host_class_hid_report_descriptor_get
1133 
1134 #if defined(UX_DEVICE_CLASS_HID_ENABLE_ERROR_CHECKING)
1135 
1136 #define ux_host_class_hid_client_register                   _uxe_host_class_hid_client_register
1137 
1138 #define ux_host_class_hid_idle_get                          _uxe_host_class_hid_idle_get
1139 #define ux_host_class_hid_idle_set                          _uxe_host_class_hid_idle_set
1140 
1141 #define ux_host_class_hid_periodic_report_start             _uxe_host_class_hid_periodic_report_start
1142 #define ux_host_class_hid_periodic_report_stop              _uxe_host_class_hid_periodic_report_stop
1143 
1144 #define ux_host_class_hid_report_callback_register          _uxe_host_class_hid_report_callback_register
1145 #define ux_host_class_hid_report_id_get                     _uxe_host_class_hid_report_id_get
1146 #define ux_host_class_hid_report_get                        _uxe_host_class_hid_report_get
1147 #define ux_host_class_hid_report_set                        _uxe_host_class_hid_report_set
1148 
1149 #else
1150 
1151 #define ux_host_class_hid_client_register                   _ux_host_class_hid_client_register
1152 
1153 #define ux_host_class_hid_idle_get                          _ux_host_class_hid_idle_get
1154 #define ux_host_class_hid_idle_set                          _ux_host_class_hid_idle_set
1155 
1156 #define ux_host_class_hid_periodic_report_start             _ux_host_class_hid_periodic_report_start
1157 #define ux_host_class_hid_periodic_report_stop              _ux_host_class_hid_periodic_report_stop
1158 
1159 #define ux_host_class_hid_report_callback_register          _ux_host_class_hid_report_callback_register
1160 #define ux_host_class_hid_report_id_get                     _ux_host_class_hid_report_id_get
1161 #define ux_host_class_hid_report_get                        _ux_host_class_hid_report_get
1162 #define ux_host_class_hid_report_set                        _ux_host_class_hid_report_set
1163 
1164 #endif
1165 
1166 
1167 /* Determine if a C++ compiler is being used.  If so, complete the standard
1168    C conditional started above.  */
1169 #ifdef __cplusplus
1170 }
1171 #endif
1172 
1173 #endif
1174 
1175