| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
usbd_hid.h
Go to the documentation of this file.
1 /***********************************************************************
2 * $Id: mw_usbd_hid.h.rca 1.2 Tue Nov 1 11:45:07 2011 nlv09221 Experimental $
3 *
4 * Project: USB device ROM Stack
5 *
6 * Description:
7 * HID Definitions.
8 *
9 ***********************************************************************
10 * Copyright(C) 2011, NXP Semiconductor
11 * All rights reserved.
12 *
13 * Software that is described herein is for illustrative purposes only
14 * which provides customers with programming information regarding the
15 * products. This software is supplied "AS IS" without any warranties.
16 * NXP Semiconductors assumes no responsibility or liability for the
17 * use of the software, conveys no license or title under any patent,
18 * copyright, or mask work right to the product. NXP Semiconductors
19 * reserves the right to make changes in the software without
20 * notification. NXP Semiconductors also make no representation or
21 * warranty that such application will be suitable for the specified
22 * use without further testing or modification.
23 **********************************************************************/
24 #ifndef __HID_H__
25 #define __HID_H__
26
27 #include "usbd.h"
28
42 #define HID_SUBCLASS_NONE 0x00
43
44 #define HID_SUBCLASS_BOOT 0x01
45
51 #define HID_PROTOCOL_NONE 0x00
52
53 #define HID_PROTOCOL_KEYBOARD 0x01
54
55 #define HID_PROTOCOL_MOUSE 0x02
56
64 #define HID_HID_DESCRIPTOR_TYPE 0x21
65
66 #define HID_REPORT_DESCRIPTOR_TYPE 0x22
67
68 #define HID_PHYSICAL_DESCRIPTOR_TYPE 0x23
69
78 PRE_PACK struct POST_PACK _HID_DESCRIPTOR {
79 uint8_t bLength;
80 uint8_t bDescriptorType;
81 uint16_t bcdHID;
82 uint8_t bCountryCode;
83 uint8_t bNumDescriptors;
85 PRE_PACK struct POST_PACK _HID_DESCRIPTOR_LIST {
86 uint8_t bDescriptorType;
87 uint16_t wDescriptorLength;
88 } DescriptorList[1];
89 } ;
91 typedef struct _HID_DESCRIPTOR HID_DESCRIPTOR;
92
93
97 #define HID_REQUEST_GET_REPORT 0x01
98 #define HID_REQUEST_GET_IDLE 0x02
99 #define HID_REQUEST_GET_PROTOCOL 0x03
100 #define HID_REQUEST_SET_REPORT 0x09
101 #define HID_REQUEST_SET_IDLE 0x0A
102 #define HID_REQUEST_SET_PROTOCOL 0x0B
103
108 #define HID_REPORT_INPUT 0x01
109 #define HID_REPORT_OUTPUT 0x02
110 #define HID_REPORT_FEATURE 0x03
111
117 #define HID_USAGE_PAGE_UNDEFINED 0x00
118 #define HID_USAGE_PAGE_GENERIC 0x01
119 #define HID_USAGE_PAGE_SIMULATION 0x02
120 #define HID_USAGE_PAGE_VR 0x03
121 #define HID_USAGE_PAGE_SPORT 0x04
122 #define HID_USAGE_PAGE_GAME 0x05
123 #define HID_USAGE_PAGE_DEV_CONTROLS 0x06
124 #define HID_USAGE_PAGE_KEYBOARD 0x07
125 #define HID_USAGE_PAGE_LED 0x08
126 #define HID_USAGE_PAGE_BUTTON 0x09
127 #define HID_USAGE_PAGE_ORDINAL 0x0A
128 #define HID_USAGE_PAGE_TELEPHONY 0x0B
129 #define HID_USAGE_PAGE_CONSUMER 0x0C
130 #define HID_USAGE_PAGE_DIGITIZER 0x0D
131 #define HID_USAGE_PAGE_UNICODE 0x10
132 #define HID_USAGE_PAGE_ALPHANUMERIC 0x14
133
139 #define HID_USAGE_GENERIC_POINTER 0x01
140 #define HID_USAGE_GENERIC_MOUSE 0x02
141 #define HID_USAGE_GENERIC_JOYSTICK 0x04
142 #define HID_USAGE_GENERIC_GAMEPAD 0x05
143 #define HID_USAGE_GENERIC_KEYBOARD 0x06
144 #define HID_USAGE_GENERIC_KEYPAD 0x07
145 #define HID_USAGE_GENERIC_X 0x30
146 #define HID_USAGE_GENERIC_Y 0x31
147 #define HID_USAGE_GENERIC_Z 0x32
148 #define HID_USAGE_GENERIC_RX 0x33
149 #define HID_USAGE_GENERIC_RY 0x34
150 #define HID_USAGE_GENERIC_RZ 0x35
151 #define HID_USAGE_GENERIC_SLIDER 0x36
152 #define HID_USAGE_GENERIC_DIAL 0x37
153 #define HID_USAGE_GENERIC_WHEEL 0x38
154 #define HID_USAGE_GENERIC_HATSWITCH 0x39
155 #define HID_USAGE_GENERIC_COUNTED_BUFFER 0x3A
156 #define HID_USAGE_GENERIC_BYTE_COUNT 0x3B
157 #define HID_USAGE_GENERIC_MOTION_WAKEUP 0x3C
158 #define HID_USAGE_GENERIC_VX 0x40
159 #define HID_USAGE_GENERIC_VY 0x41
160 #define HID_USAGE_GENERIC_VZ 0x42
161 #define HID_USAGE_GENERIC_VBRX 0x43
162 #define HID_USAGE_GENERIC_VBRY 0x44
163 #define HID_USAGE_GENERIC_VBRZ 0x45
164 #define HID_USAGE_GENERIC_VNO 0x46
165 #define HID_USAGE_GENERIC_SYSTEM_CTL 0x80
166 #define HID_USAGE_GENERIC_SYSCTL_POWER 0x81
167 #define HID_USAGE_GENERIC_SYSCTL_SLEEP 0x82
168 #define HID_USAGE_GENERIC_SYSCTL_WAKE 0x83
169 #define HID_USAGE_GENERIC_SYSCTL_CONTEXT_MENU 0x84
170 #define HID_USAGE_GENERIC_SYSCTL_MAIN_MENU 0x85
171 #define HID_USAGE_GENERIC_SYSCTL_APP_MENU 0x86
172 #define HID_USAGE_GENERIC_SYSCTL_HELP_MENU 0x87
173 #define HID_USAGE_GENERIC_SYSCTL_MENU_EXIT 0x88
174 #define HID_USAGE_GENERIC_SYSCTL_MENU_SELECT 0x89
175 #define HID_USAGE_GENERIC_SYSCTL_MENU_RIGHT 0x8A
176 #define HID_USAGE_GENERIC_SYSCTL_MENU_LEFT 0x8B
177 #define HID_USAGE_GENERIC_SYSCTL_MENU_UP 0x8C
178 #define HID_USAGE_GENERIC_SYSCTL_MENU_DOWN 0x8D
179
184 #define HID_USAGE_SIMULATION_RUDDER 0xBA
185 #define HID_USAGE_SIMULATION_THROTTLE 0xBB
186
188 /* Virtual Reality Controls Page (0x03) */
189 /* ... */
190
191 /* Sport Controls Page (0x04) */
192 /* ... */
193
194 /* Game Controls Page (0x05) */
195 /* ... */
196
197 /* Generic Device Controls Page (0x06) */
198 /* ... */
199
204 #define HID_USAGE_KEYBOARD_NOEVENT 0x00
205 #define HID_USAGE_KEYBOARD_ROLLOVER 0x01
206 #define HID_USAGE_KEYBOARD_POSTFAIL 0x02
207 #define HID_USAGE_KEYBOARD_UNDEFINED 0x03
208
210 #define HID_USAGE_KEYBOARD_aA 0x04
211 #define HID_USAGE_KEYBOARD_zZ 0x1D
212
214 #define HID_USAGE_KEYBOARD_ONE 0x1E
215 #define HID_USAGE_KEYBOARD_ZERO 0x27
216
217 #define HID_USAGE_KEYBOARD_RETURN 0x28
218 #define HID_USAGE_KEYBOARD_ESCAPE 0x29
219 #define HID_USAGE_KEYBOARD_DELETE 0x2A
220
222 #define HID_USAGE_KEYBOARD_F1 0x3A
223 #define HID_USAGE_KEYBOARD_F12 0x45
224
225 #define HID_USAGE_KEYBOARD_PRINT_SCREEN 0x46
226
228 #define HID_USAGE_KEYBOARD_LCTRL 0xE0
229 #define HID_USAGE_KEYBOARD_LSHFT 0xE1
230 #define HID_USAGE_KEYBOARD_LALT 0xE2
231 #define HID_USAGE_KEYBOARD_LGUI 0xE3
232 #define HID_USAGE_KEYBOARD_RCTRL 0xE4
233 #define HID_USAGE_KEYBOARD_RSHFT 0xE5
234 #define HID_USAGE_KEYBOARD_RALT 0xE6
235 #define HID_USAGE_KEYBOARD_RGUI 0xE7
236 #define HID_USAGE_KEYBOARD_SCROLL_LOCK 0x47
237 #define HID_USAGE_KEYBOARD_NUM_LOCK 0x53
238 #define HID_USAGE_KEYBOARD_CAPS_LOCK 0x39
239
241 /* ... */
242
246 #define HID_USAGE_LED_NUM_LOCK 0x01
247 #define HID_USAGE_LED_CAPS_LOCK 0x02
248 #define HID_USAGE_LED_SCROLL_LOCK 0x03
249 #define HID_USAGE_LED_COMPOSE 0x04
250 #define HID_USAGE_LED_KANA 0x05
251 #define HID_USAGE_LED_POWER 0x06
252 #define HID_USAGE_LED_SHIFT 0x07
253 #define HID_USAGE_LED_DO_NOT_DISTURB 0x08
254 #define HID_USAGE_LED_MUTE 0x09
255 #define HID_USAGE_LED_TONE_ENABLE 0x0A
256 #define HID_USAGE_LED_HIGH_CUT_FILTER 0x0B
257 #define HID_USAGE_LED_LOW_CUT_FILTER 0x0C
258 #define HID_USAGE_LED_EQUALIZER_ENABLE 0x0D
259 #define HID_USAGE_LED_SOUND_FIELD_ON 0x0E
260 #define HID_USAGE_LED_SURROUND_FIELD_ON 0x0F
261 #define HID_USAGE_LED_REPEAT 0x10
262 #define HID_USAGE_LED_STEREO 0x11
263 #define HID_USAGE_LED_SAMPLING_RATE_DETECT 0x12
264 #define HID_USAGE_LED_SPINNING 0x13
265 #define HID_USAGE_LED_CAV 0x14
266 #define HID_USAGE_LED_CLV 0x15
267 #define HID_USAGE_LED_RECORDING_FORMAT_DET 0x16
268 #define HID_USAGE_LED_OFF_HOOK 0x17
269 #define HID_USAGE_LED_RING 0x18
270 #define HID_USAGE_LED_MESSAGE_WAITING 0x19
271 #define HID_USAGE_LED_DATA_MODE 0x1A
272 #define HID_USAGE_LED_BATTERY_OPERATION 0x1B
273 #define HID_USAGE_LED_BATTERY_OK 0x1C
274 #define HID_USAGE_LED_BATTERY_LOW 0x1D
275 #define HID_USAGE_LED_SPEAKER 0x1E
276 #define HID_USAGE_LED_HEAD_SET 0x1F
277 #define HID_USAGE_LED_HOLD 0x20
278 #define HID_USAGE_LED_MICROPHONE 0x21
279 #define HID_USAGE_LED_COVERAGE 0x22
280 #define HID_USAGE_LED_NIGHT_MODE 0x23
281 #define HID_USAGE_LED_SEND_CALLS 0x24
282 #define HID_USAGE_LED_CALL_PICKUP 0x25
283 #define HID_USAGE_LED_CONFERENCE 0x26
284 #define HID_USAGE_LED_STAND_BY 0x27
285 #define HID_USAGE_LED_CAMERA_ON 0x28
286 #define HID_USAGE_LED_CAMERA_OFF 0x29
287 #define HID_USAGE_LED_ON_LINE 0x2A
288 #define HID_USAGE_LED_OFF_LINE 0x2B
289 #define HID_USAGE_LED_BUSY 0x2C
290 #define HID_USAGE_LED_READY 0x2D
291 #define HID_USAGE_LED_PAPER_OUT 0x2E
292 #define HID_USAGE_LED_PAPER_JAM 0x2F
293 #define HID_USAGE_LED_REMOTE 0x30
294 #define HID_USAGE_LED_FORWARD 0x31
295 #define HID_USAGE_LED_REVERSE 0x32
296 #define HID_USAGE_LED_STOP 0x33
297 #define HID_USAGE_LED_REWIND 0x34
298 #define HID_USAGE_LED_FAST_FORWARD 0x35
299 #define HID_USAGE_LED_PLAY 0x36
300 #define HID_USAGE_LED_PAUSE 0x37
301 #define HID_USAGE_LED_RECORD 0x38
302 #define HID_USAGE_LED_ERROR 0x39
303 #define HID_USAGE_LED_SELECTED_INDICATOR 0x3A
304 #define HID_USAGE_LED_IN_USE_INDICATOR 0x3B
305 #define HID_USAGE_LED_MULTI_MODE_INDICATOR 0x3C
306 #define HID_USAGE_LED_INDICATOR_ON 0x3D
307 #define HID_USAGE_LED_INDICATOR_FLASH 0x3E
308 #define HID_USAGE_LED_INDICATOR_SLOW_BLINK 0x3F
309 #define HID_USAGE_LED_INDICATOR_FAST_BLINK 0x40
310 #define HID_USAGE_LED_INDICATOR_OFF 0x41
311 #define HID_USAGE_LED_FLASH_ON_TIME 0x42
312 #define HID_USAGE_LED_SLOW_BLINK_ON_TIME 0x43
313 #define HID_USAGE_LED_SLOW_BLINK_OFF_TIME 0x44
314 #define HID_USAGE_LED_FAST_BLINK_ON_TIME 0x45
315 #define HID_USAGE_LED_FAST_BLINK_OFF_TIME 0x46
316 #define HID_USAGE_LED_INDICATOR_COLOR 0x47
317 #define HID_USAGE_LED_RED 0x48
318 #define HID_USAGE_LED_GREEN 0x49
319 #define HID_USAGE_LED_AMBER 0x4A
320 #define HID_USAGE_LED_GENERIC_INDICATOR 0x4B
321
323 /* Button Page (0x09)
324 */
325 /* There is no need to label these usages. */
326
327 /* Ordinal Page (0x0A)
328 */
329 /* There is no need to label these usages. */
330
334 #define HID_USAGE_TELEPHONY_PHONE 0x01
335 #define HID_USAGE_TELEPHONY_ANSWERING_MACHINE 0x02
336 #define HID_USAGE_TELEPHONY_MESSAGE_CONTROLS 0x03
337 #define HID_USAGE_TELEPHONY_HANDSET 0x04
338 #define HID_USAGE_TELEPHONY_HEADSET 0x05
339 #define HID_USAGE_TELEPHONY_KEYPAD 0x06
340 #define HID_USAGE_TELEPHONY_PROGRAMMABLE_BUTTON 0x07
341
342 /* ... */
343
347 #define HID_USAGE_CONSUMER_CONTROL 0x01
348 #define HID_USAGE_CONSUMER_FAST_FORWARD 0xB3
349 #define HID_USAGE_CONSUMER_REWIND 0xB4
350 #define HID_USAGE_CONSUMER_PLAY_PAUSE 0xCD
351 #define HID_USAGE_CONSUMER_VOLUME_INCREMENT 0xE9
352 #define HID_USAGE_CONSUMER_VOLUME_DECREMENT 0xEA
353
354 /* ... */
355
356 /* and others ... */
357
358
363 #define HID_Input(x) 0x81,x
364 #define HID_Output(x) 0x91,x
365 #define HID_Feature(x) 0xB1,x
366 #define HID_Collection(x) 0xA1,x
367 #define HID_EndCollection 0xC0
368
370 #define HID_Data 0<<0
371 #define HID_Constant 1<<0
372 #define HID_Array 0<<1
373 #define HID_Variable 1<<1
374 #define HID_Absolute 0<<2
375 #define HID_Relative 1<<2
376 #define HID_NoWrap 0<<3
377 #define HID_Wrap 1<<3
378 #define HID_Linear 0<<4
379 #define HID_NonLinear 1<<4
380 #define HID_PreferredState 0<<5
381 #define HID_NoPreferred 1<<5
382 #define HID_NoNullPosition 0<<6
383 #define HID_NullState 1<<6
384 #define HID_NonVolatile 0<<7
385 #define HID_Volatile 1<<7
386
388 #define HID_Physical 0x00
389 #define HID_Application 0x01
390 #define HID_Logical 0x02
391 #define HID_Report 0x03
392 #define HID_NamedArray 0x04
393 #define HID_UsageSwitch 0x05
394 #define HID_UsageModifier 0x06
395
397 #define HID_UsagePage(x) 0x05,x
398 #define HID_UsagePageVendor(x) 0x06,x,0xFF
399 #define HID_LogicalMin(x) 0x15,x
400 #define HID_LogicalMinS(x) 0x16,(x&0xFF),((x>>8)&0xFF)
401 #define HID_LogicalMinL(x) 0x17,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF)
402 #define HID_LogicalMax(x) 0x25,x
403 #define HID_LogicalMaxS(x) 0x26,(x&0xFF),((x>>8)&0xFF)
404 #define HID_LogicalMaxL(x) 0x27,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF)
405 #define HID_PhysicalMin(x) 0x35,x
406 #define HID_PhysicalMinS(x) 0x36,(x&0xFF),((x>>8)&0xFF)
407 #define HID_PhysicalMinL(x) 0x37,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF)
408 #define HID_PhysicalMax(x) 0x45,x
409 #define HID_PhysicalMaxS(x) 0x46,(x&0xFF),((x>>8)&0xFF)
410 #define HID_PhysicalMaxL(x) 0x47,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF)
411 #define HID_UnitExponent(x) 0x55,x
412 #define HID_Unit(x) 0x65,x
413 #define HID_UnitS(x) 0x66,(x&0xFF),((x>>8)&0xFF)
414 #define HID_UnitL(x) 0x67,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF)
415 #define HID_ReportSize(x) 0x75,x
416 #define HID_ReportID(x) 0x85,x
417 #define HID_ReportCount(x) 0x95,x
418 #define HID_Push 0xA0
419 #define HID_Pop 0xB0
420
422 #define HID_Usage(x) 0x09,x
423 #define HID_UsageMin(x) 0x19,x
424 #define HID_UsageMax(x) 0x29,x
425
429 #endif /* __HID_H__ */