hid.h revision 1.6 1 1.6 msaitoh /* $NetBSD: hid.h,v 1.6 2020/03/11 16:05:31 msaitoh Exp $ */
2 1.1 bouyer /* $FreeBSD: src/sys/dev/usb/hid.h,v 1.7 1999/11/17 22:33:40 n_hibma Exp $ */
3 1.1 bouyer
4 1.1 bouyer /*
5 1.1 bouyer * Copyright (c) 1998 The NetBSD Foundation, Inc.
6 1.1 bouyer * All rights reserved.
7 1.1 bouyer *
8 1.1 bouyer * This code is derived from software contributed to The NetBSD Foundation
9 1.1 bouyer * by Lennart Augustsson (lennart (at) augustsson.net) at
10 1.1 bouyer * Carlstedt Research & Technology.
11 1.1 bouyer *
12 1.1 bouyer * Redistribution and use in source and binary forms, with or without
13 1.1 bouyer * modification, are permitted provided that the following conditions
14 1.1 bouyer * are met:
15 1.1 bouyer * 1. Redistributions of source code must retain the above copyright
16 1.1 bouyer * notice, this list of conditions and the following disclaimer.
17 1.1 bouyer * 2. Redistributions in binary form must reproduce the above copyright
18 1.1 bouyer * notice, this list of conditions and the following disclaimer in the
19 1.1 bouyer * documentation and/or other materials provided with the distribution.
20 1.1 bouyer *
21 1.1 bouyer * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
22 1.1 bouyer * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 1.1 bouyer * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 1.1 bouyer * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25 1.1 bouyer * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 1.1 bouyer * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 1.1 bouyer * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 1.1 bouyer * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 1.1 bouyer * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 1.1 bouyer * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 1.1 bouyer * POSSIBILITY OF SUCH DAMAGE.
32 1.1 bouyer */
33 1.1 bouyer
34 1.1 bouyer #ifndef _HIDHID_H_
35 1.1 bouyer #define _HIDHID_H_
36 1.1 bouyer
37 1.2 bouyer #if defined(_KERNEL) || defined(_RUMPKERNEL)
38 1.1 bouyer
39 1.1 bouyer enum hid_kind {
40 1.1 bouyer hid_input,
41 1.1 bouyer hid_output,
42 1.1 bouyer hid_feature,
43 1.1 bouyer hid_collection,
44 1.1 bouyer hid_endcollection,
45 1.1 bouyer hid_none
46 1.1 bouyer };
47 1.1 bouyer
48 1.1 bouyer struct hid_location {
49 1.1 bouyer uint32_t size;
50 1.1 bouyer uint32_t count;
51 1.1 bouyer uint32_t pos;
52 1.1 bouyer };
53 1.1 bouyer
54 1.1 bouyer struct hid_item {
55 1.1 bouyer /* Global */
56 1.3 jakllsch uint32_t _usage_page;
57 1.1 bouyer int32_t logical_minimum;
58 1.1 bouyer int32_t logical_maximum;
59 1.1 bouyer int32_t physical_minimum;
60 1.1 bouyer int32_t physical_maximum;
61 1.3 jakllsch uint32_t unit_exponent;
62 1.3 jakllsch uint32_t unit;
63 1.3 jakllsch uint32_t report_ID;
64 1.1 bouyer /* Local */
65 1.3 jakllsch uint32_t usage;
66 1.3 jakllsch uint32_t usage_minimum;
67 1.3 jakllsch uint32_t usage_maximum;
68 1.3 jakllsch uint32_t designator_index;
69 1.3 jakllsch uint32_t designator_minimum;
70 1.3 jakllsch uint32_t designator_maximum;
71 1.3 jakllsch uint32_t string_index;
72 1.3 jakllsch uint32_t string_minimum;
73 1.3 jakllsch uint32_t string_maximum;
74 1.3 jakllsch uint32_t set_delimiter;
75 1.1 bouyer /* Misc */
76 1.3 jakllsch uint32_t collection;
77 1.1 bouyer int collevel;
78 1.1 bouyer enum hid_kind kind;
79 1.1 bouyer uint32_t flags;
80 1.1 bouyer /* Location */
81 1.1 bouyer struct hid_location loc;
82 1.1 bouyer /* */
83 1.1 bouyer struct hid_item *next;
84 1.1 bouyer };
85 1.1 bouyer
86 1.1 bouyer struct hid_data *hid_start_parse(const void *, int, enum hid_kind);
87 1.1 bouyer void hid_end_parse(struct hid_data *);
88 1.1 bouyer int hid_get_item(struct hid_data *, struct hid_item *);
89 1.1 bouyer int hid_report_size(const void *, int, enum hid_kind, uint8_t);
90 1.1 bouyer int hid_locate(const void *, int, uint32_t, uint8_t, enum hid_kind,
91 1.1 bouyer struct hid_location *, uint32_t *);
92 1.1 bouyer long hid_get_data(const u_char *, const struct hid_location *);
93 1.1 bouyer u_long hid_get_udata(const u_char *, const struct hid_location *);
94 1.1 bouyer int hid_is_collection(const void *, int, uint8_t, uint32_t);
95 1.1 bouyer
96 1.2 bouyer #endif /* _KERNEL || _RUMPKERNEL */
97 1.1 bouyer
98 1.1 bouyer /* Usage pages */
99 1.6 msaitoh #define HUP_UNDEFINED 0x0000U
100 1.6 msaitoh #define HUP_GENERIC_DESKTOP 0x0001U
101 1.6 msaitoh #define HUP_SIMULATION 0x0002U
102 1.6 msaitoh #define HUP_VR_CONTROLS 0x0003U
103 1.6 msaitoh #define HUP_SPORTS_CONTROLS 0x0004U
104 1.6 msaitoh #define HUP_GAMING_CONTROLS 0x0005U
105 1.6 msaitoh #define HUP_KEYBOARD 0x0007U
106 1.6 msaitoh #define HUP_LEDS 0x0008U
107 1.6 msaitoh #define HUP_BUTTON 0x0009U
108 1.6 msaitoh #define HUP_ORDINALS 0x000aU
109 1.6 msaitoh #define HUP_TELEPHONY 0x000bU
110 1.6 msaitoh #define HUP_CONSUMER 0x000cU
111 1.6 msaitoh #define HUP_DIGITIZERS 0x000dU
112 1.6 msaitoh #define HUP_PHYSICAL_IFACE 0x000eU
113 1.6 msaitoh #define HUP_UNICODE 0x0010U
114 1.6 msaitoh #define HUP_ALPHANUM_DISPLAY 0x0014U
115 1.6 msaitoh #define HUP_MONITOR 0x0080U
116 1.6 msaitoh #define HUP_MONITOR_ENUM_VAL 0x0081U
117 1.6 msaitoh #define HUP_VESA_VC 0x0082U
118 1.6 msaitoh #define HUP_VESA_CMD 0x0083U
119 1.6 msaitoh #define HUP_POWER 0x0084U
120 1.6 msaitoh #define HUP_BATTERY 0x0085U
121 1.6 msaitoh #define HUP_BARCODE_SCANNER 0x008bU
122 1.6 msaitoh #define HUP_SCALE 0x008cU
123 1.6 msaitoh #define HUP_CAMERA_CONTROL 0x0090U
124 1.6 msaitoh #define HUP_ARCADE 0x0091U
125 1.6 msaitoh #define HUP_VENDOR 0x00ffU
126 1.5 msaitoh #define HUP_FIDO 0xf1d0U
127 1.5 msaitoh #define HUP_MICROSOFT 0xff00U
128 1.1 bouyer /* XXX compat */
129 1.6 msaitoh #define HUP_APPLE 0x00ffU
130 1.6 msaitoh #define HUP_WACOM 0xff00U
131 1.1 bouyer
132 1.1 bouyer /* Usages, Power Device */
133 1.6 msaitoh #define HUP_INAME 0x0001U
134 1.6 msaitoh #define HUP_PRESENT_STATUS 0x0002U
135 1.6 msaitoh #define HUP_CHANGED_STATUS 0x0003U
136 1.6 msaitoh #define HUP_UPS 0x0004U
137 1.6 msaitoh #define HUP_POWER_SUPPLY 0x0005U
138 1.6 msaitoh #define HUP_BATTERY_SYSTEM 0x0010U
139 1.6 msaitoh #define HUP_BATTERY_SYSTEM_ID 0x0011U
140 1.6 msaitoh #define HUP_PD_BATTERY 0x0012U
141 1.6 msaitoh #define HUP_BATTERY_ID 0x0013U
142 1.6 msaitoh #define HUP_CHARGER 0x0014U
143 1.6 msaitoh #define HUP_CHARGER_ID 0x0015U
144 1.6 msaitoh #define HUP_POWER_CONVERTER 0x0016U
145 1.6 msaitoh #define HUP_POWER_CONVERTER_ID 0x0017U
146 1.6 msaitoh #define HUP_OUTLET_SYSTEM 0x0018U
147 1.6 msaitoh #define HUP_OUTLET_SYSTEM_ID 0x0019U
148 1.6 msaitoh #define HUP_INPUT 0x001aU
149 1.6 msaitoh #define HUP_INPUT_ID 0x001bU
150 1.6 msaitoh #define HUP_OUTPUT 0x001cU
151 1.6 msaitoh #define HUP_OUTPUT_ID 0x001dU
152 1.6 msaitoh #define HUP_FLOW 0x001eU
153 1.6 msaitoh #define HUP_FLOW_ID 0x001fU
154 1.6 msaitoh #define HUP_OUTLET 0x0020U
155 1.6 msaitoh #define HUP_OUTLET_ID 0x0021U
156 1.6 msaitoh #define HUP_GANG 0x0022U
157 1.6 msaitoh #define HUP_GANG_ID 0x0023U
158 1.6 msaitoh #define HUP_POWER_SUMMARY 0x0024U
159 1.6 msaitoh #define HUP_POWER_SUMMARY_ID 0x0025U
160 1.6 msaitoh #define HUP_VOLTAGE 0x0030U
161 1.6 msaitoh #define HUP_CURRENT 0x0031U
162 1.6 msaitoh #define HUP_FREQUENCY 0x0032U
163 1.6 msaitoh #define HUP_APPARENT_POWER 0x0033U
164 1.6 msaitoh #define HUP_ACTIVE_POWER 0x0034U
165 1.6 msaitoh #define HUP_PERCENT_LOAD 0x0035U
166 1.6 msaitoh #define HUP_TEMPERATURE 0x0036U
167 1.6 msaitoh #define HUP_HUMIDITY 0x0037U
168 1.6 msaitoh #define HUP_BADCOUNT 0x0038U
169 1.6 msaitoh #define HUP_CONFIG_VOLTAGE 0x0040U
170 1.6 msaitoh #define HUP_CONFIG_CURRENT 0x0041U
171 1.6 msaitoh #define HUP_CONFIG_FREQUENCY 0x0042U
172 1.6 msaitoh #define HUP_CONFIG_APP_POWER 0x0043U
173 1.6 msaitoh #define HUP_CONFIG_ACT_POWER 0x0044U
174 1.6 msaitoh #define HUP_CONFIG_PERCENT_LOAD 0x0045U
175 1.6 msaitoh #define HUP_CONFIG_TEMPERATURE 0x0046U
176 1.6 msaitoh #define HUP_CONFIG_HUMIDITY 0x0047U
177 1.6 msaitoh #define HUP_SWITCHON_CONTROL 0x0050U
178 1.6 msaitoh #define HUP_SWITCHOFF_CONTROL 0x0051U
179 1.6 msaitoh #define HUP_TOGGLE_CONTROL 0x0052U
180 1.6 msaitoh #define HUP_LOW_VOLT_TRANSF 0x0053U
181 1.6 msaitoh #define HUP_HIGH_VOLT_TRANSF 0x0054U
182 1.6 msaitoh #define HUP_DELAYBEFORE_REBOOT 0x0055U
183 1.6 msaitoh #define HUP_DELAYBEFORE_STARTUP 0x0056U
184 1.6 msaitoh #define HUP_DELAYBEFORE_SHUTDWN 0x0057U
185 1.6 msaitoh #define HUP_TEST 0x0058U
186 1.6 msaitoh #define HUP_MODULE_RESET 0x0059U
187 1.6 msaitoh #define HUP_AUDIBLE_ALRM_CTL 0x005aU
188 1.6 msaitoh #define HUP_PRESENT 0x0060U
189 1.6 msaitoh #define HUP_GOOD 0x0061U
190 1.6 msaitoh #define HUP_INTERNAL_FAILURE 0x0062U
191 1.6 msaitoh #define HUP_PD_VOLT_OUTOF_RANGE 0x0063U
192 1.6 msaitoh #define HUP_FREQ_OUTOFRANGE 0x0064U
193 1.6 msaitoh #define HUP_OVERLOAD 0x0065U
194 1.6 msaitoh #define HUP_OVERCHARGED 0x0066U
195 1.6 msaitoh #define HUP_OVERTEMPERATURE 0x0067U
196 1.6 msaitoh #define HUP_SHUTDOWN_REQUESTED 0x0068U
197 1.6 msaitoh #define HUP_SHUTDOWN_IMMINENT 0x0069U
198 1.6 msaitoh #define HUP_SWITCH_ON_OFF 0x006bU
199 1.6 msaitoh #define HUP_SWITCHABLE 0x006cU
200 1.6 msaitoh #define HUP_USED 0x006dU
201 1.6 msaitoh #define HUP_BOOST 0x006eU
202 1.6 msaitoh #define HUP_BUCK 0x006fU
203 1.6 msaitoh #define HUP_INITIALIZED 0x0070U
204 1.6 msaitoh #define HUP_TESTED 0x0071U
205 1.6 msaitoh #define HUP_AWAITING_POWER 0x0072U
206 1.6 msaitoh #define HUP_COMMUNICATION_LOST 0x0073U
207 1.6 msaitoh #define HUP_IMANUFACTURER 0x00fdU
208 1.6 msaitoh #define HUP_IPRODUCT 0x00feU
209 1.6 msaitoh #define HUP_ISERIALNUMBER 0x00ffU
210 1.1 bouyer
211 1.1 bouyer /* Usages, Battery */
212 1.6 msaitoh #define HUB_SMB_BATTERY_MODE 0x0001U
213 1.6 msaitoh #define HUB_SMB_BATTERY_STATUS 0x0002U
214 1.6 msaitoh #define HUB_SMB_ALARM_WARNING 0x0003U
215 1.6 msaitoh #define HUB_SMB_CHARGER_MODE 0x0004U
216 1.6 msaitoh #define HUB_SMB_CHARGER_STATUS 0x0005U
217 1.6 msaitoh #define HUB_SMB_CHARGER_SPECINF 0x0006U
218 1.6 msaitoh #define HUB_SMB_SELECTR_STATE 0x0007U
219 1.6 msaitoh #define HUB_SMB_SELECTR_PRESETS 0x0008U
220 1.6 msaitoh #define HUB_SMB_SELECTR_INFO 0x0009U
221 1.6 msaitoh #define HUB_SMB_OPT_MFGFUNC1 0x0010U
222 1.6 msaitoh #define HUB_SMB_OPT_MFGFUNC2 0x0011U
223 1.6 msaitoh #define HUB_SMB_OPT_MFGFUNC3 0x0012U
224 1.6 msaitoh #define HUB_SMB_OPT_MFGFUNC4 0x0013U
225 1.6 msaitoh #define HUB_SMB_OPT_MFGFUNC5 0x0014U
226 1.6 msaitoh #define HUB_CONNECTIONTOSMBUS 0x0015U
227 1.6 msaitoh #define HUB_OUTPUT_CONNECTION 0x0016U
228 1.6 msaitoh #define HUB_CHARGER_CONNECTION 0x0017U
229 1.6 msaitoh #define HUB_BATTERY_INSERTION 0x0018U
230 1.6 msaitoh #define HUB_USENEXT 0x0019U
231 1.6 msaitoh #define HUB_OKTOUSE 0x001aU
232 1.6 msaitoh #define HUB_BATTERY_SUPPORTED 0x001bU
233 1.6 msaitoh #define HUB_SELECTOR_REVISION 0x001cU
234 1.6 msaitoh #define HUB_CHARGING_INDICATOR 0x001dU
235 1.6 msaitoh #define HUB_MANUFACTURER_ACCESS 0x0028U
236 1.6 msaitoh #define HUB_REM_CAPACITY_LIM 0x0029U
237 1.6 msaitoh #define HUB_REM_TIME_LIM 0x002aU
238 1.6 msaitoh #define HUB_ATRATE 0x002bU
239 1.6 msaitoh #define HUB_CAPACITY_MODE 0x002cU
240 1.6 msaitoh #define HUB_BCAST_TO_CHARGER 0x002dU
241 1.6 msaitoh #define HUB_PRIMARY_BATTERY 0x002eU
242 1.6 msaitoh #define HUB_CHANGE_CONTROLLER 0x002fU
243 1.6 msaitoh #define HUB_TERMINATE_CHARGE 0x0040U
244 1.6 msaitoh #define HUB_TERMINATE_DISCHARGE 0x0041U
245 1.6 msaitoh #define HUB_BELOW_REM_CAP_LIM 0x0042U
246 1.6 msaitoh #define HUB_REM_TIME_LIM_EXP 0x0043U
247 1.6 msaitoh #define HUB_CHARGING 0x0044U
248 1.6 msaitoh #define HUB_DISCHARGING 0x0045U
249 1.6 msaitoh #define HUB_FULLY_CHARGED 0x0046U
250 1.6 msaitoh #define HUB_FULLY_DISCHARGED 0x0047U
251 1.6 msaitoh #define HUB_CONDITIONING_FLAG 0x0048U
252 1.6 msaitoh #define HUB_ATRATE_OK 0x0049U
253 1.6 msaitoh #define HUB_SMB_ERROR_CODE 0x004aU
254 1.6 msaitoh #define HUB_NEED_REPLACEMENT 0x004bU
255 1.6 msaitoh #define HUB_ATRATE_TIMETOFULL 0x0060U
256 1.6 msaitoh #define HUB_ATRATE_TIMETOEMPTY 0x0061U
257 1.6 msaitoh #define HUB_AVERAGE_CURRENT 0x0062U
258 1.6 msaitoh #define HUB_MAXERROR 0x0063U
259 1.6 msaitoh #define HUB_REL_STATEOF_CHARGE 0x0064U
260 1.6 msaitoh #define HUB_ABS_STATEOF_CHARGE 0x0065U
261 1.6 msaitoh #define HUB_REM_CAPACITY 0x0066U
262 1.6 msaitoh #define HUB_FULLCHARGE_CAPACITY 0x0067U
263 1.6 msaitoh #define HUB_RUNTIMETO_EMPTY 0x0068U
264 1.6 msaitoh #define HUB_AVERAGETIMETO_EMPTY 0x0069U
265 1.6 msaitoh #define HUB_AVERAGETIMETO_FULL 0x006aU
266 1.6 msaitoh #define HUB_CYCLECOUNT 0x006bU
267 1.6 msaitoh #define HUB_BATTPACKMODEL_LEVEL 0x0080U
268 1.6 msaitoh #define HUB_INTERNAL_CHARGE_CTL 0x0081U
269 1.6 msaitoh #define HUB_PRIMARY_BATTERY_SUP 0x0082U
270 1.6 msaitoh #define HUB_DESIGN_CAPACITY 0x0083U
271 1.6 msaitoh #define HUB_SPECIFICATION_INFO 0x0084U
272 1.6 msaitoh #define HUB_MANUFACTURER_DATE 0x0085U
273 1.6 msaitoh #define HUB_SERIAL_NUMBER 0x0086U
274 1.6 msaitoh #define HUB_IMANUFACTURERNAME 0x0087U
275 1.6 msaitoh #define HUB_IDEVICENAME 0x0088U
276 1.6 msaitoh #define HUB_IDEVICECHEMISTERY 0x0089U
277 1.6 msaitoh #define HUB_MANUFACTURERDATA 0x008aU
278 1.6 msaitoh #define HUB_RECHARGABLE 0x008bU
279 1.6 msaitoh #define HUB_WARN_CAPACITY_LIM 0x008cU
280 1.6 msaitoh #define HUB_CAPACITY_GRANUL1 0x008dU
281 1.6 msaitoh #define HUB_CAPACITY_GRANUL2 0x008eU
282 1.6 msaitoh #define HUB_IOEM_INFORMATION 0x008fU
283 1.6 msaitoh #define HUB_INHIBIT_CHARGE 0x00c0U
284 1.6 msaitoh #define HUB_ENABLE_POLLING 0x00c1U
285 1.6 msaitoh #define HUB_RESTORE_TO_ZERO 0x00c2U
286 1.6 msaitoh #define HUB_AC_PRESENT 0x00d0U
287 1.6 msaitoh #define HUB_BATTERY_PRESENT 0x00d1U
288 1.6 msaitoh #define HUB_POWER_FAIL 0x00d2U
289 1.6 msaitoh #define HUB_ALARM_INHIBITED 0x00d3U
290 1.6 msaitoh #define HUB_THERMISTOR_UNDRANGE 0x00d4U
291 1.6 msaitoh #define HUB_THERMISTOR_HOT 0x00d5U
292 1.6 msaitoh #define HUB_THERMISTOR_COLD 0x00d6U
293 1.6 msaitoh #define HUB_THERMISTOR_OVERANGE 0x00d7U
294 1.6 msaitoh #define HUB_BS_VOLT_OUTOF_RANGE 0x00d8U
295 1.6 msaitoh #define HUB_BS_CURR_OUTOF_RANGE 0x00d9U
296 1.6 msaitoh #define HUB_BS_CURR_NOT_REGULTD 0x00daU
297 1.6 msaitoh #define HUB_BS_VOLT_NOT_REGULTD 0x00dbU
298 1.6 msaitoh #define HUB_MASTER_MODE 0x00dcU
299 1.6 msaitoh #define HUB_CHARGER_SELECTR_SUP 0x00f0U
300 1.6 msaitoh #define HUB_CHARGER_SPEC 0x00f1U
301 1.6 msaitoh #define HUB_LEVEL2 0x00f2U
302 1.6 msaitoh #define HUB_LEVEL3 0x00f3U
303 1.1 bouyer
304 1.1 bouyer /* Usages, generic desktop */
305 1.6 msaitoh #define HUG_POINTER 0x0001U
306 1.6 msaitoh #define HUG_MOUSE 0x0002U
307 1.6 msaitoh #define HUG_FN_KEY 0x0003U
308 1.6 msaitoh #define HUG_JOYSTICK 0x0004U
309 1.6 msaitoh #define HUG_GAME_PAD 0x0005U
310 1.6 msaitoh #define HUG_KEYBOARD 0x0006U
311 1.6 msaitoh #define HUG_KEYPAD 0x0007U
312 1.6 msaitoh #define HUG_X 0x0030U
313 1.6 msaitoh #define HUG_Y 0x0031U
314 1.6 msaitoh #define HUG_Z 0x0032U
315 1.6 msaitoh #define HUG_RX 0x0033U
316 1.6 msaitoh #define HUG_RY 0x0034U
317 1.6 msaitoh #define HUG_RZ 0x0035U
318 1.6 msaitoh #define HUG_SLIDER 0x0036U
319 1.6 msaitoh #define HUG_DIAL 0x0037U
320 1.6 msaitoh #define HUG_WHEEL 0x0038U
321 1.6 msaitoh #define HUG_HAT_SWITCH 0x0039U
322 1.6 msaitoh #define HUG_COUNTED_BUFFER 0x003aU
323 1.6 msaitoh #define HUG_BYTE_COUNT 0x003bU
324 1.6 msaitoh #define HUG_MOTION_WAKEUP 0x003cU
325 1.6 msaitoh #define HUG_VX 0x0040U
326 1.6 msaitoh #define HUG_VY 0x0041U
327 1.6 msaitoh #define HUG_VZ 0x0042U
328 1.6 msaitoh #define HUG_VBRX 0x0043U
329 1.6 msaitoh #define HUG_VBRY 0x0044U
330 1.6 msaitoh #define HUG_VBRZ 0x0045U
331 1.6 msaitoh #define HUG_VNO 0x0046U
332 1.6 msaitoh #define HUG_TWHEEL 0x0048U
333 1.6 msaitoh #define HUG_SYSTEM_CONTROL 0x0080U
334 1.6 msaitoh #define HUG_SYSTEM_POWER_DOWN 0x0081U
335 1.6 msaitoh #define HUG_SYSTEM_SLEEP 0x0082U
336 1.6 msaitoh #define HUG_SYSTEM_WAKEUP 0x0083U
337 1.6 msaitoh #define HUG_SYSTEM_CONTEXT_MENU 0x0084U
338 1.6 msaitoh #define HUG_SYSTEM_MAIN_MENU 0x0085U
339 1.6 msaitoh #define HUG_SYSTEM_APP_MENU 0x0086U
340 1.6 msaitoh #define HUG_SYSTEM_MENU_HELP 0x0087U
341 1.6 msaitoh #define HUG_SYSTEM_MENU_EXIT 0x0088U
342 1.6 msaitoh #define HUG_SYSTEM_MENU_SELECT 0x0089U
343 1.6 msaitoh #define HUG_SYSTEM_MENU_RIGHT 0x008aU
344 1.6 msaitoh #define HUG_SYSTEM_MENU_LEFT 0x008bU
345 1.6 msaitoh #define HUG_SYSTEM_MENU_UP 0x008cU
346 1.6 msaitoh #define HUG_SYSTEM_MENU_DOWN 0x008dU
347 1.1 bouyer
348 1.1 bouyer /* Usages, Digitizers */
349 1.6 msaitoh #define HUD_UNDEFINED 0x0000U
350 1.6 msaitoh #define HUD_DIGITIZER 0x0001U
351 1.6 msaitoh #define HUD_PEN 0x0002U
352 1.6 msaitoh #define HUD_TOUCH_SCREEN 0x0004U
353 1.6 msaitoh #define HUD_TOUCHPAD 0x0005U
354 1.6 msaitoh #define HUD_CONFIG 0x000eU
355 1.6 msaitoh #define HUD_FINGER 0x0022U
356 1.6 msaitoh #define HUD_TIP_PRESSURE 0x0030U
357 1.6 msaitoh #define HUD_BARREL_PRESSURE 0x0031U
358 1.6 msaitoh #define HUD_IN_RANGE 0x0032U
359 1.6 msaitoh #define HUD_TOUCH 0x0033U
360 1.6 msaitoh #define HUD_UNTOUCH 0x0034U
361 1.6 msaitoh #define HUD_TAP 0x0035U
362 1.6 msaitoh #define HUD_QUALITY 0x0036U
363 1.6 msaitoh #define HUD_DATA_VALID 0x0037U
364 1.6 msaitoh #define HUD_TRANSDUCER_INDEX 0x0038U
365 1.6 msaitoh #define HUD_TABLET_FKEYS 0x0039U
366 1.6 msaitoh #define HUD_PROGRAM_CHANGE_KEYS 0x003aU
367 1.6 msaitoh #define HUD_BATTERY_STRENGTH 0x003bU
368 1.6 msaitoh #define HUD_INVERT 0x003cU
369 1.6 msaitoh #define HUD_X_TILT 0x003dU
370 1.6 msaitoh #define HUD_Y_TILT 0x003eU
371 1.6 msaitoh #define HUD_AZIMUTH 0x003fU
372 1.6 msaitoh #define HUD_ALTITUDE 0x0040U
373 1.6 msaitoh #define HUD_TWIST 0x0041U
374 1.6 msaitoh #define HUD_TIP_SWITCH 0x0042U
375 1.6 msaitoh #define HUD_SEC_TIP_SWITCH 0x0043U
376 1.6 msaitoh #define HUD_BARREL_SWITCH 0x0044U
377 1.6 msaitoh #define HUD_ERASER 0x0045U
378 1.6 msaitoh #define HUD_TABLET_PICK 0x0046U
379 1.6 msaitoh #define HUD_CONFIDENCE 0x0047U
380 1.6 msaitoh #define HUD_WIDTH 0x0048U
381 1.6 msaitoh #define HUD_HEIGHT 0x0049U
382 1.6 msaitoh #define HUD_CONTACTID 0x0051U
383 1.6 msaitoh #define HUD_INPUT_MODE 0x0052U
384 1.6 msaitoh #define HUD_DEVICE_INDEX 0x0053U
385 1.6 msaitoh #define HUD_CONTACTCOUNT 0x0054U
386 1.6 msaitoh #define HUD_CONTACT_MAX 0x0055U
387 1.6 msaitoh #define HUD_SCAN_TIME 0x0056U
388 1.6 msaitoh #define HUD_BUTTON_TYPE 0x0059U
389 1.1 bouyer
390 1.1 bouyer /* Usages, LED */
391 1.6 msaitoh #define HUD_LED_NUM_LOCK 0x0001U
392 1.6 msaitoh #define HUD_LED_CAPS_LOCK 0x0002U
393 1.6 msaitoh #define HUD_LED_SCROLL_LOCK 0x0003U
394 1.6 msaitoh #define HUD_LED_COMPOSE 0x0004U
395 1.6 msaitoh #define HUD_LED_KANA 0x0005U
396 1.1 bouyer
397 1.1 bouyer /* Usages, Consumer */
398 1.6 msaitoh #define HUC_AC_PAN 0x0238U
399 1.1 bouyer
400 1.4 christos /* Usages, FIDO */
401 1.6 msaitoh #define HUF_U2FHID 0x0001U
402 1.4 christos
403 1.1 bouyer #define HID_USAGE2(p, u) (((p) << 16) | u)
404 1.1 bouyer #define HID_GET_USAGE(u) ((u) & 0xffff)
405 1.1 bouyer #define HID_GET_USAGE_PAGE(u) (((u) >> 16) & 0xffff)
406 1.1 bouyer
407 1.1 bouyer #define HCOLL_PHYSICAL 0
408 1.1 bouyer #define HCOLL_APPLICATION 1
409 1.1 bouyer #define HCOLL_LOGICAL 2
410 1.1 bouyer
411 1.1 bouyer /* Bits in the input/output/feature items */
412 1.1 bouyer #define HIO_CONST 0x001
413 1.1 bouyer #define HIO_VARIABLE 0x002
414 1.1 bouyer #define HIO_RELATIVE 0x004
415 1.1 bouyer #define HIO_WRAP 0x008
416 1.1 bouyer #define HIO_NONLINEAR 0x010
417 1.1 bouyer #define HIO_NOPREF 0x020
418 1.1 bouyer #define HIO_NULLSTATE 0x040
419 1.1 bouyer #define HIO_VOLATILE 0x080
420 1.1 bouyer #define HIO_BUFBYTES 0x100
421 1.1 bouyer
422 1.1 bouyer /* Valid values for the country codes */
423 1.1 bouyer #define HCC_UNDEFINED 0x00
424 1.1 bouyer #define HCC_MAX 0x23
425 1.1 bouyer
426 1.1 bouyer #endif /* _HIDHID_H_ */
427