在USB中,USB Host是通过各种描述符来识别识别设备的,一般在设备枚举的过程将会获取有设备描述符/配置描述符/接口描述符/端点描述符/字符串描述符等

现在我们来介绍一下HID ReportDesc.

我们看一下在其内容为

 

我们先来使用HID Descriptor Tool来生成上面的数据

 

 小结

USAGE_PAGE

You first set a usage page.  Above it is using 'Generic Desktop'

USAGE_PAGE page is much like a namespace.

See "HID Usage" in the specs.

USAGE

A usage from the available usages in the usage page setting

COLLECTION

Allows you to define different groups of related attributes etc

INPUT

Data,Var,Abs

Add the above data variables to the report

Cnst,Var,Abs

Add the above constant variables to the report (e.g. padding bits to byte align for the next data section)

 

 

 

参考资料

具体协议文档:

1、Device Class Definition for Human Interface Devices (HID) Version 1.11 .PDF

2、HID Usage Tables 1.12.PDF

 

(个人觉得这个非常推荐看)Tutorial about USB HID Report Descriptors:

3、http://eleccelerator.com/tutorial-about-usb-hid-report-descriptors/

 

posted on 2017-05-11 12:36  陌鉎こ城sHi  阅读(7842)  评论(0编辑  收藏  举报