Custom HID device HID report descriptor

后端 未结 5 1841
误落风尘
误落风尘 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 05:05

    Here is a link to the Spec Sheet (or "manual") for your reading purposes.

    To answer some of your questions, REPORT_SIZE is specified in bits and REPORT_COUNT can be used to specify how many "Usages" are being reported with the indicated properties. For example, you can set the properties for the X and Y usages and the have the REPORT_COUNT specified as 2 (one for X and one for Y) and then specify the INPUT to add those usages to the report. Then continue on describing other usages.

    Also, don't forget to have the usages byte aligned. Since REPORT_COUNT is specified in bits, it is easy to forget to have usages byte aligned. So if one usage is only 1 bit, then you need to specify that there will be 7 bits in that byte not being used before moving to the next usage if it requires more than 7 bits.

提交回复
热议问题