在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/