Kaleidoscope
DescriptorPrimitives.h
Go to the documentation of this file.
1 #pragma once
2 
3 #define D_MULTIBYTE(n) (n + 0x01)
4 
5 #define D_USAGE_PAGE 0x05
6 #define D_USAGE 0x09
7 
8 
9 #define D_REPORT_ID 0x85
10 
11 #define D_USAGE_MINIMUM 0x19
12 #define D_USAGE_MAXIMUM 0x29
13 
14 #define D_LOGICAL_MINIMUM 0x15
15 #define D_LOGICAL_MAXIMUM 0x25
16 
17 #define D_REPORT_SIZE 0x75
18 #define D_REPORT_COUNT 0x95
19 
20 
21 // USB HID DCD 1.11 section 6.2.2.4 - Main items
22 //
23 // each of these are the type description + 0x01 for a single byte item
24 #define D_INPUT 0x81
25 #define D_OUTPUT 0x91
26 #define D_FEATURE 0xb1
27 #define D_COLLECTION 0xa1
28 #define D_END_COLLECTION 0xc0
29 
30 // The bits that make up inputs, outputs and features
31 
32 // Bit 0
33 #define D_DATA 0b00000000
34 #define D_CONSTANT 0b00000001
35 // Bit 1
36 #define D_ARRAY 0b00000000
37 #define D_VARIABLE 0b00000010
38 // Bit 2
39 #define D_ABSOLUTE 0b00000000
40 #define D_RELATIVE 0b00000100
41 // Bit 3
42 #define D_NO_WRAP 0b00000000
43 #define D_WRAP 0b00001000
44 // Bit 4
45 #define D_LINEAR 0b00000000
46 #define D_NON_LINEAR 0b00010000
47 // Bit 5
48 #define D_PREFERRED_STATE 0b00000000
49 #define D_NO_PREFERRED 0b00100000
50 // Bit 6
51 #define D_NO_NULL_POSITION 0b00000000
52 #define D_NULL_STATE 0b01000000
53 // Bit 7
54 #define D_NON_VOLATILE 0b00000000
55 #define D_VOLATILE 0b01000000
56 
57 // Bit 8
58 #define D_BIT_FIELD 0b00000000
59 #define D_BUFFERED_BYTES 0b10000000
60 
61 
62 
63 // Collection types
64 
65 
66 #define D_PHYSICAL 0x00 // (group of axes)
67 #define D_APPLICATION 0x01 // (mouse, keyboard)
68 #define D_LOGICAL 0x02// (interrelated data)
69 #define D_REPORT 0x03
70 #define D_NAMED_ARRAY 0x04
71 #define D_USAGE_SWITCH 0x05
72 #define D_USAGE_MODIFIER 0x06
73 // 0x07-0x7f - Reserved
74 // 0x80-0xff - Vendor define
75 
76 
77 #define D_PAGE_GENERIC_DESKTOP 0x01
78 #define D_PAGE_SIMULATION 0x02
79 #define D_PAGE_VR 0x03
80 #define D_PAGE_SPORT 0x04
81 #define D_PAGE_GAME 0x05
82 #define D_PAGE_GENERIC_DEVICE 0x06
83 #define D_PAGE_KEYBOARD 0x07
84 #define D_PAGE_LEDS 0x08
85 #define D_PAGE_BUTTON 0x09
86 #define D_PAGE_ORDINAL 0x0A
87 #define D_PAGE_TELEPHONY 0x0B
88 #define D_PAGE_CONSUMER 0x0C
89 #define D_PAGE_DIGITIZER 0x0D
90 #define D_PAGE_RESERVED 0x0E
91 #define D_PAGE_PID 0x0F
92 #define D_PAGE_UNICODE 0x10
93 // 0x11-13 RESERVED
94 #define D_PAGE_ALPHANUMERIC_DISPLAY 0x14
95 #define D_PAGE_MEDICAL_INSTRUMENTS 0x40
96 // 0x80-83 MONITOR
97 // 0x84-87 POWER
98 #define D_PAGE_BAR_CODE_SCANNER 0x8C
99 #define D_PAGE_SCALE 0x8D
100 #define D_PAGE_MSR 0x8E
101 // 0x8F RESERVED POINT OF SALE
102 #define D_PAGE_CAMERA_CONTROL 0x90
103 #define D_PAGE_ARCADE 0x91
104 
105 
106 // Generic Desktop Usages HUT Section 4 p27
107 
108 
109 #define D_USAGE_POINTER 0x01
110 #define D_USAGE_MOUSE 0x02
111 // 0x03 is reserved
112 #define D_USAGE_JOYSTICK 0x04
113 #define D_USAGE_GAMEPAD 0x05
114 #define D_USAGE_KEYBOARD 0x06
115 #define D_USAGE_KEYPAD 0x07
116 #define D_USAGE_MULITAXIS 0x08