32 HID

V0.0.1

32.1 Histroy

  • 2014-10-13, rayoslee, release V0.0.1

32.2 FAQ

  1. How to config kernel for HID in S605-32 BSP?
    • make menuconfig
      • USB support–>Support for Host-side USB–>OHCI HCD support–>Nuvoton W55FA93 OHCI support–>USB OHCI type(USB host-like Port 2)
      • HID Devices–>/dev/hidraw raw HID device support(enable)
      • Multimedia support–>Video capture adapters–>V4L USB devices(disable)
    • Save config file and ./build sd or spi
  2. Refer to hidusb.tar.xz, GAS senaor sample code
  3. How to get USB(HID) device information?
    • dmesg | grep hid to get VID:PID [Mon Oct 13 11:43:49 2014] hid-generic 0003:03EB:2402.0002: hiddev0,hidraw1: USB HID v1.11 Device
      [Cambridge CMOS Sensors (UK) CCS801-EVK3] on usb-0000:0e:00.0-2/input0

    • sudo lsusb -v -d 03eb:2402 to get endpoint

    Bus 003 Device 008: ID 03eb:2402 Atmel Corp. 
    Device Descriptor:
    bLength                18
    DescriptorType         1
    bcdUSB               2.00
    bDeviceClass            0 (Defined at Interface level)
    bDeviceSubClass         0 
    bDeviceProtocol         0 
    bMaxPacketSize0         8
    idVendor           0x03eb Atmel Corp.
    idProduct          0x2402 
    bcdDevice            1.00
    iManufacturer           1 Cambridge CMOS Sensors (UK)
    iProduct                2 CCS801-EVK3
    iSerial                 0 
    bNumConfigurations      1
    Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      53
          Report Descriptor: (length is 53)
            Item(Global): Usage Page, data= [ 0xff 0xff ] 65535
                            (null)
            Item(Local ): Usage, data= [ 0x01 ] 1
                            (null)
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Local ): Usage, data= [ 0x02 ] 2
                            (null)
            Item(Local ): Usage, data= [ 0x03 ] 3
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x40 ] 64
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Local ): Usage, data= [ 0x04 ] 4
                            (null)
            Item(Local ): Usage, data= [ 0x05 ] 5
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x40 ] 64
            Item(Main  ): Output, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Local ): Usage, data= [ 0x06 ] 6
                            (null)
            Item(Local ): Usage, data= [ 0x07 ] 7
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x04 ] 4
            Item(Main  ): Feature, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5

    bEndpointAddress 0x81 EP 1 IN

        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              20
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5

    bEndpointAddress 0x02 EP 2 OUT

        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              20  
    Device Status:     0x0001
      Self Powered