1 #ifndef DEVICES_USB_HID_H
2 #define DEVICES_USB_HID_H
4 ** $VER: usb_hid.h 2.0 (15.12.07)
6 ** usb definitions include file
8 ** (C) Copyright 2002-2007 Chris Hodges
12 #include <exec/types.h>
18 /* Usb Hid Requests */
19 #define UHR_GET_REPORT 0x01
20 #define UHR_GET_IDLE 0x02
21 #define UHR_GET_PROTOCOL 0x03
22 #define UHR_SET_REPORT 0x09
23 #define UHR_SET_IDLE 0x0a
24 #define UHR_SET_PROTOCOL 0x0b
26 /* HID class specific descriptors */
28 #define UDT_REPORT 0x22
29 #define UDT_PHYSICAL 0x23
32 #define HID_NO_SUBCLASS 0x00
33 #define HID_BOOT_SUBCLASS 0x01
35 /* Hid Proto if HID_BOOT_SUBCLASS */
36 #define HID_PROTO_KEYBOARD 0x01
37 #define HID_PROTO_MOUSE 0x02
39 /* Hid Proto values for UHR_SET_PROTOCOL */
40 #define HID_PROTO_BOOT 0x00
41 #define HID_PROTO_REPORT 0x01
43 /* Usb Class Specific Descriptor: HID Descriptor */
47 UBYTE bLength
; /* total size of the HID descriptor */
48 UBYTE bDescriptorType
; /* Descriptor Type, value UDT_HID for HID */
49 UWORD bcdHID
; /* the HID Class Spec release */
50 UBYTE bCountryCode
; /* country code of the localized hardware. */
51 UBYTE bNumDescriptors
; /* number of class descriptors (>=1) */
52 UBYTE bDescType
; /* type of class descriptor */
53 UBYTE wDescLength
; /* (WORD!) total size of the Report descriptor */
57 /* HID Report Item stuff */
59 #define REPORT_LONGITEM 0xfe
60 #define REPORT_ISIZE_0 0x00
61 #define REPORT_ISIZE_1 0x01
62 #define REPORT_ISIZE_2 0x02
63 #define REPORT_ISIZE_4 0x03
64 #define REPORT_ISIZE_MASK 0x03
66 #define REPORT_ITYPE_MAIN 0x00
67 #define REPORT_ITYPE_GLOBAL 0x04
68 #define REPORT_ITYPE_LOCAL 0x08
69 #define REPORT_ITYPE_MASK 0x0c
71 #define REPORT_ITAG_MASK 0xf0
74 #define REPORT_MAIN_INPUT 0x80
75 #define REPORT_MAIN_OUTPUT 0x90
76 #define REPORT_MAIN_COLLECT 0xa0
77 #define REPORT_MAIN_FEATURE 0xb0
78 #define REPORT_MAIN_ENDCOLL 0xc0
81 #define REPORT_GLOB_USAGE 0x00
82 #define REPORT_GLOB_LOGMIN 0x10
83 #define REPORT_GLOB_LOGMAX 0x20
84 #define REPORT_GLOB_PHYMIN 0x30
85 #define REPORT_GLOB_PHYMAX 0x40
86 #define REPORT_GLOB_UNITEXP 0x50
87 #define REPORT_GLOB_UNIT 0x60
88 #define REPORT_GLOB_RPSIZE 0x70
89 #define REPORT_GLOB_RPID 0x80
90 #define REPORT_GLOB_RPCOUNT 0x90
91 #define REPORT_GLOB_PUSH 0xa0
92 #define REPORT_GLOB_POP 0xb0
95 #define REPORT_LOCL_USAGE 0x00
96 #define REPORT_LOCL_USEMIN 0x10
97 #define REPORT_LOCL_USEMAX 0x20
98 #define REPORT_LOCL_DESIDX 0x30
99 #define REPORT_LOCL_DESMIN 0x40
100 #define REPORT_LOCL_DESMAX 0x50
101 #define REPORT_LOCL_STRIDX 0x70
102 #define REPORT_LOCL_STRMIN 0x80
103 #define REPORT_LOCL_STRMAX 0x90
104 #define REPORT_LOCL_DELIM 0xa0
106 /* Unit data definitons */
108 #define RP_UNIT_NONE 0x0
110 /* System units (nibble 0) */
111 #define RP_UNIT_SILINEAR 0x1
112 #define RP_UNIT_SIROTATION 0x2
113 #define RP_UNIT_ENGLINEAR 0x3
114 #define RP_UNIT ENGROTATION 0x4
116 /* Length units (nibble 1) */
117 #define RP_UNIT_CM 0x1
118 #define RP_UNIT_RAD 0x2
119 #define RP_UNIT_INCH 0x3
120 #define RP_UNIT_DEG 0x4
122 /* Mass units (nibble 2) */
123 #define RP_UNIT_GRAM1 0x1
124 #define RP_UNIT_GRAM2 0x2
125 #define RP_UNIT_SLUG1 0x3
126 #define RP_UNIT_SLUG2 0x4
128 /* Time units (nibble 3) */
129 #define RP_UNIT_SECS1 0x1
130 #define RP_UNIT_SECS2 0x2
131 #define RP_UNIT_SECS3 0x3
132 #define RP_UNIT_SECS4 0x4
134 /* Temperature units (nibble 4) */
135 #define RP_UNIT_KELVIN1 0x1
136 #define RP_UNIT_KELVIN2 0x2
137 #define RP_UNIT_FAHRENHEIT1 0x3
138 #define RP_UNIT_FAHRENHEIT2 0x4
140 /* Current units (nibble 5) */
141 #define RP_UNIT_AMPERE1 0x1
142 #define RP_UNIT_AMPERE2 0x2
143 #define RP_UNIT_AMPERE3 0x3
144 #define RP_UNIT_AMPERE4 0x4
146 /* Lumious intensity units (nibble 6) */
147 #define RP_UNIT_CANDELA1 0x1
148 #define RP_UNIT_CANDELA2 0x2
149 #define RP_UNIT_CANDELA3 0x3
150 #define RP_UNIT_CANDELA4 0x4
153 /* Data for input/output/feature main items */
155 #define RPF_MAIN_CONST 0x0001 /* !DATA */
156 #define RPF_MAIN_VARIABLE 0x0002 /* !ARRAY */
157 #define RPF_MAIN_RELATIVE 0x0004 /* !ABSOLUTE */
158 #define RPF_MAIN_WRAP 0x0008 /* !NOWRAP */
159 #define RPF_MAIN_NONLINEAR 0x0010 /* !LINEAR */
160 #define RPF_MAIN_NOPREF 0x0020 /* !PREFERRED */
161 #define RPF_MAIN_NULLSTATE 0x0040 /* !NO NULL POS */
162 #define RPF_MAIN_VOLATILE 0x0080 /* !NON VOLATILE (only output/feature) */
163 #define RPF_MAIN_BUFBYTES 0x0100 /* !BITFIELD */
165 /* Data for collection main items */
167 #define RP_COLL_PHYSICAL 0x00 /* group of axes */
168 #define RP_COLL_APP 0x01 /* mouse, keyboard */
169 #define RP_COLL_LOGICAL 0x02 /* interrelated data */
170 #define RP_COLL_REPORT 0x03 /* Collection around a report */
171 #define RP_COLL_NAMEDARRAY 0x04 /* Named Array, array of selector usages */
172 #define RP_COLL_USAGESWITCH 0x05 /* Usage Switch */
173 #define RP_COLL_USAGEMODIFIER 0x06 /* Usage Modifier */
177 #define RP_PAGE_GENERIC 0x01
178 #define RP_PAGE_SIMCTRLS 0x02
179 #define RP_PAGE_VRCTRLS 0x03
180 #define RP_PAGE_SPORTCTRLS 0x04
181 #define RP_PAGE_GAMECTRLS 0x05
182 #define RP_PAGE_KEYBOARD 0x07
183 #define RP_PAGE_LEDS 0x08
184 #define RP_PAGE_BUTTON 0x09
185 #define RP_PAGE_ORDINAL 0x0a
186 #define RP_PAGE_TELEPHONY 0x0b
187 #define RP_PAGE_CONSUMER 0x0c
188 #define RP_PAGE_DIGITIZER 0x0d
189 #define RP_PAGE_PID 0x0f
190 #define RP_PAGE_UNICODE 0x10
191 #define RP_PAGE_ALPHADISP 0x14
192 #define RP_PAGE_MONITOR 0x80
193 #define RP_PAGE_MONITORENUM 0x81
194 #define RP_PAGE_MONITORVESA 0x82
195 #define RP_PAGE_POWER 0x84
196 #define RP_PAGE_CAMERACTRL 0x90
197 #define RP_PAGE_ARCADE 0x91
199 #if defined(__GNUC__)
203 #endif /* DEVICES_USB_HID_H */