各位大神,下午好!今天调试C8051F320的USB HID通讯,到官网上去下了一个代码例程,上位机HID下传用的Report ID为00,但是这个官网代码用的Report ID为02,哪个大神能告诉如何更改一下,不胜感激。
code const hid_report_descriptor HIDREPORTDESC =
{
0x06, 0x00, 0xff, // USAGE_PAGE (Vendor Defined Page 1)
0x09, 0x01, // USAGE (Vendor Usage 1)
0xa1, 0x01, // COLLECTION (Application)
0x85, IN_CONTROL, // Report ID
0x95, IN_CONTROL_SIZE, // REPORT_COUNT ()
0x75, 0x08, // REPORT_SIZE (8)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x09, 0x01, // USAGE (Vendor Usage 1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x85, OUT_CONTROL, // Report ID
0x95, OUT_CONTROL_SIZE, // REPORT_COUNT ()
0x75, 0x08, // REPORT_SIZE (8)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x09, 0x01, // USAGE (Vendor Usage 1)
0x91, 0x02, // OUTPUT (Data,Var,Abs)
0x85, IN_DATA, // Report ID
0x95, IN_DATA_SIZE, // REPORT_COUNT ()
0x75, 0x08, // REPORT_SIZE (8)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x09, 0x01, // USAGE (Vendor Usage 1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x85, OUT_DATA, // Report ID
0x95, OUT_DATA_SIZE, // REPORT_COUNT ()
0x75, 0x08, // REPORT_SIZE (8)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x09, 0x01, // USAGE (Vendor Usage 1)
0x91, 0x02, // OUTPUT (Data,Var,Abs)
0xC0 // end Application Collection
}; |