x1input_rdesc.h revision 1.1.2.2.4.1 1 1.1.2.2.4.1 skrll /* $NetBSD: x1input_rdesc.h,v 1.1.2.2.4.1 2016/09/06 20:33:09 skrll Exp $ */
2 1.1.2.2 snj
3 1.1.2.2 snj /*-
4 1.1.2.2 snj * Copyright (C) 2014 Loic Nageleisen
5 1.1.2.2 snj * All rights reserved.
6 1.1.2.2 snj *
7 1.1.2.2 snj * Redistribution and use in source and binary forms, with or without
8 1.1.2.2 snj * modification, are permitted provided that the following conditions are met:
9 1.1.2.2 snj * * Redistributions of source code must retain the above copyright
10 1.1.2.2 snj * notice, this list of conditions and the following disclaimer.
11 1.1.2.2 snj * * Redistributions in binary form must reproduce the above copyright
12 1.1.2.2 snj * notice, this list of conditions and the following disclaimer in the
13 1.1.2.2 snj * documentation and/or other materials provided with the distribution.
14 1.1.2.2 snj * * Neither the name of the copyright holders nor the
15 1.1.2.2 snj * names of its contributors may be used to endorse or promote products
16 1.1.2.2 snj * derived from this software without specific prior written permission.
17 1.1.2.2.4.1 skrll *
18 1.1.2.2 snj * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 1.1.2.2 snj * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 1.1.2.2 snj * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 1.1.2.2 snj * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
22 1.1.2.2 snj * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 1.1.2.2 snj * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 1.1.2.2 snj * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 1.1.2.2 snj * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 1.1.2.2 snj * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 1.1.2.2 snj * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 1.1.2.2 snj */
29 1.1.2.2 snj
30 1.1.2.2.4.1 skrll #define USBIF_IS_X1INPUT(uiaa) \
31 1.1.2.2.4.1 skrll ((uiaa)->uiaa_class == UICLASS_VENDOR && \
32 1.1.2.2.4.1 skrll (uiaa)->uiaa_subclass == 0x47 && \
33 1.1.2.2.4.1 skrll (uiaa)->uiaa_proto == 0xd0)
34 1.1.2.2 snj
35 1.1.2.2 snj static const uByte uhid_x1input_report_descr[] = {
36 1.1.2.2 snj 0x05, 0x01, // Usage Page (Generic Desktop)
37 1.1.2.2 snj 0x09, 0x05, // Usage (Game Pad)
38 1.1.2.2 snj 0xa1, 0x01, // Collection (Application)
39 1.1.2.2 snj
40 1.1.2.2 snj // # button packet
41 1.1.2.2 snj 0xa1, 0x00, // Collection (Physical)
42 1.1.2.2 snj 0x85, 0x20, // Report ID (0x20)
43 1.1.2.2 snj
44 1.1.2.2 snj // # skip unknown field and counter
45 1.1.2.2 snj 0x05, 0x01, // Usage Page (Generic Desktop)
46 1.1.2.2 snj 0x09, 0x00, // Usage (Undefined)
47 1.1.2.2 snj 0x75, 0x08, // Report Size (8)
48 1.1.2.2 snj 0x95, 0x02, // Report Count (2)
49 1.1.2.2 snj 0x81, 0x03, // Input (Constant, Variable, Absolute)
50 1.1.2.2 snj
51 1.1.2.2 snj // payload size
52 1.1.2.2 snj 0x05, 0x01, // Usage Page (Generic Desktop)
53 1.1.2.2 snj 0x09, 0x3b, // Usage (Byte Count)
54 1.1.2.2 snj 0x75, 0x08, // Report Size (8)
55 1.1.2.2 snj 0x95, 0x01, // Report Count (1)
56 1.1.2.2 snj 0x81, 0x02, // Input (Data, Variable, Absolute)
57 1.1.2.2 snj
58 1.1.2.2 snj // # 16 buttons
59 1.1.2.2 snj 0x05, 0x09, // Usage Page (Button)
60 1.1.2.2 snj 0x19, 0x01, // Usage Minimum (Button 1)
61 1.1.2.2 snj 0x29, 0x10, // Usage Maximum (Button 16)
62 1.1.2.2 snj 0x15, 0x00, // Logical Minimum (0)
63 1.1.2.2 snj 0x25, 0x01, // Logical Maximum (1)
64 1.1.2.2 snj 0x75, 0x01, // Report Size (1)
65 1.1.2.2 snj 0x95, 0x10, // Report Count (16)
66 1.1.2.2 snj 0x81, 0x02, // Input (Data, Variable, Absolute)
67 1.1.2.2 snj
68 1.1.2.2 snj // # triggers
69 1.1.2.2 snj 0x15, 0x00, // Logical Minimum (0)
70 1.1.2.2 snj 0x26, 0xff, 0x03, // Logical Maximum (1023)
71 1.1.2.2 snj 0x35, 0x00, // Physical Minimum (0)
72 1.1.2.2 snj 0x46, 0xff, 0x03, // Physical Maximum (1023)
73 1.1.2.2 snj 0x75, 0x10, // Report Size (16)
74 1.1.2.2 snj 0x95, 0x02, // Report Count (2)
75 1.1.2.2 snj 0x05, 0x01, // Usage Page (Generic Desktop)
76 1.1.2.2 snj 0x09, 0x33, // Usage (Rx)
77 1.1.2.2 snj 0x09, 0x34, // Usage (Ry)
78 1.1.2.2 snj 0x81, 0x02, // Input (Data, Variable, Absolute)
79 1.1.2.2 snj
80 1.1.2.2 snj // # sticks
81 1.1.2.2 snj 0x75, 0x10, // Report Size (16)
82 1.1.2.2 snj 0x16, 0x00, 0x80, // Logical Minimum (-32768)
83 1.1.2.2 snj 0x26, 0xff, 0x7f, // Logical Maximum (32767)
84 1.1.2.2 snj 0x36, 0x00, 0x80, // Physical Minimum (-32768)
85 1.1.2.2 snj 0x46, 0xff, 0x7f, // Physical Maximum (32767)
86 1.1.2.2 snj 0x05, 0x01, // Usage Page (Generic Desktop)
87 1.1.2.2 snj 0x09, 0x01, // Usage (Pointer)
88 1.1.2.2 snj 0xa1, 0x00, // Collection (Physical)
89 1.1.2.2 snj 0x95, 0x02, // Report Count (2)
90 1.1.2.2 snj 0x05, 0x01, // Usage Page (Generic Desktop)
91 1.1.2.2 snj 0x09, 0x30, // Usage (X)
92 1.1.2.2 snj 0x09, 0x31, // Usage (Y)
93 1.1.2.2 snj 0x81, 0x02, // Input (Data, Variable, Absolute)
94 1.1.2.2 snj 0xc0, // End Collection
95 1.1.2.2 snj 0x05, 0x01, // Usage Page (Generic Desktop)
96 1.1.2.2 snj 0x09, 0x01, // Usage (Pointer)
97 1.1.2.2 snj 0xa1, 0x00, // Collection (Physical)
98 1.1.2.2 snj 0x95, 0x02, // Report Count (2)
99 1.1.2.2 snj 0x05, 0x01, // Usage Page (Generic Desktop)
100 1.1.2.2 snj 0x09, 0x32, // Usage (Z)
101 1.1.2.2 snj 0x09, 0x35, // Usage (Rz)
102 1.1.2.2 snj 0x81, 0x02, // Input (Data, Variable, Absolute)
103 1.1.2.2 snj 0xc0, // End Collection
104 1.1.2.2 snj 0xc0, // End Collection
105 1.1.2.2 snj };
106