Custom HID device HID report descriptor

后端 未结 5 1848
误落风尘
误落风尘 2020-12-24 04:45

I have a bit of a problem with generating a HID descriptor. I want to use simple reports with ID1 for input and ID2 for output with 64 bytes of data.

I realized that

5条回答
  •  鱼传尺愫
    2020-12-24 04:50

    I've got my custom HID device detected by Windows 7 with this (built by guess and stealing from examples):

    {
        0x05, 0x01,         // USAGE_PAGE (Generic Desktop)
        0x09, 0x00,         // USAGE (Undefined)
        0xa1, 0x01,         // COLLECTION (Application)
        0x15, 0x00,         //   LOGICAL_MINIMUM (0)
        0x26, 0xff, 0x00,   //   LOGICAL_MAXIMUM (255)
        0x85, 0x01,         //   REPORT_ID (1)
        0x75, 0x08,         //   REPORT_SIZE (8)
        0x95, 0x40,         //   REPORT_COUNT (64)
        0x09, 0x00,         //   USAGE (Undefined)
        0x81, 0x82,         //   INPUT (Data,Var,Abs,Vol) - to the host
        0x85, 0x02,         //   REPORT_ID (2)
        0x75, 0x08,         //   REPORT_SIZE (8)
        0x95, 0x40,         //   REPORT_COUNT (64)
        0x09, 0x00,         //   USAGE (Undefined)
        0x91, 0x82,         //   OUTPUT (Data,Var,Abs,Vol) - from the host
        0xc0                // END_COLLECTION
    }; /* CustomHID_ReportDescriptor */
    

    I'm not sure if it will work properly though. We will see.

提交回复
热议问题