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