cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with combining mouse, keyboard and media descriptors into one HID

GS2
Senior

Hello,
I have combine mouse with keyboard HID_12 and keyboard with media HID_23,
but not able to combine mouse with media and all 3 together! Any help with resolving the problem will be greatly appreciated!


Here are my HID_12  and HID_23:

HID_12  
0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */
0x09, 0x02, /* USAGE (Mouse) */
0xa1, 0x01, /* COLLECTION (Application) */
0x85, MOUSE_REPORT_ID, /* Report ID (1) */
0x09, 0x01, /* USAGE (Pointer) */
0xa1, 0x00, /* COLLECTION (Physical) */
0x05, 0x09, /* USAGE_PAGE (Button) */
0x19, 0x01, /* USAGE_MINIMUM (Button 1) */
0x29, 0x03, /* USAGE_MAXIMUM (Button 3) */
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
0x95, 0x03, /* REPORT_COUNT (3) */
0x75, 0x01, /* REPORT_SIZE (1) */
0x81, 0x02, /* INPUT (Data,Var,Abs) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x75, 0x05, /* REPORT_SIZE (5) */
0x81, 0x03, /* INPUT (Cnst,Var,Abs) */
0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */
0x09, 0x30, /* USAGE (X) */
0x09, 0x31, /* USAGE (Y) */
0x09, 0x38, /* USAGE (Wheel) */
0x15, 0x81, /* LOGICAL_MINIMUM (-127) */
0x25, 0x7f, /* LOGICAL_MAXIMUM (127) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x95, 0x03, /* REPORT_COUNT (3) */
0x81, 0x06, /* INPUT (Data,Var,Rel) */
0xc0, /* END_COLLECTION (Physical) */
0xc0, /* END_COLLECTION (Application) */

0x09, 0x06, /* USAGE (Keyboard) */
0xa1, 0x01, /* COLLECTION (Application) */
0x85, KEYBOARD_REPORT_ID, /* REPORT ID (0x02) */
0x05, 0x07, /* USAGE_PAGE (Keyboard) */
0xa1, 0x01, /* COLLECTION (Application) */
0x95, 0x08, /* REPORT_COUNT (8) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
0x25, 0xff, /* LOGICAL_MAXIMUM (255) */
0x19, 0x00, /* USAGE_MINIMUM (0) */
0x29, 0xff, /* USAGE_MAXIMUM (255) */
0x81, 0x00, /* INPUT (Data,Var,Abs) */
0xc0, /* END_COLLECTION (Application) */
0xc0, /* END_COLLECTION (Application) */

HID_23
0x05, 0x01, /* USAGE_PAGE (Generic Desktop)*/
0x09, 0x06, /* USAGE (Keyboard) */
0xa1, 0x01, /* COLLECTION (Application) */
0x85, KEYBOARD_REPORT_ID, /* REPORT ID (0x02) */
0x05, 0x07, /* USAGE_PAGE (Keyboard) */
0xa1, 0x01, /* COLLECTION (Application) */
0x95, 0x08, /* REPORT_COUNT (8) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
0x25, 0xff, /* LOGICAL_MAXIMUM (255) */
0x19, 0x00, /* USAGE_MINIMUM (0) */
0x29, 0xff, /* USAGE_MAXIMUM (255) */
0x81, 0x00, /* INPUT (Data,Var,Abs) */
0xc0, /* END_COLLECTION (Application) */
0xc0, /* END_COLLECTION (Application) */

0x05, 0x0c, // USAGE_PAGE (Consumer Devices) // 3 - OK - PC Volume Down
0x09, 0x01, // USAGE (Consumer Control)
0xa1, 0x01, /* COLLECTION (Application) */
0x05, 0x0c, /* USAGE_PAGE (Consumer) */
0x09, 0x01, /* USAGE (Consumer Control) */
0xa1, 0x01, /* COLLECTION (Application) */
0x85, MEDIA_REPORT_ID, /* REPORT ID (0x03) */
0x95, 0x02, /* REPORT_COUNT (2) */
0x75, 0x10, /* REPORT_SIZE (16) */
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
0x26, 0x9C, 0x02, /* LOGICAL_MAXIMUM (1) */
0x19, 0x00, /* USAGE_MINIMUM */
0x2A, 0x9C, 0x02, /* USAGE_MAXIMUM */
0x81, 0x00, /* INPUT (Data,Var,Abs) */
0xc0, /* END_COLLECTION (Application) */
0xc0, /* END_COLLECTION (Application) */

3 REPLIES 3
GS2
Senior

Anybody!

STTwo-32
ST Employee

Hello @GS2 

You have to add more details on your configuration, what you are having as problem, so our community members will maybe try to help you. Also, if you need dedicated support to your Case, you may want to use the ST online support Channel.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Pavel A.
Evangelist III

Please elaborate "not able". What does not work? What the host sees?

It looks like a single-function USB HID device with multiple top level collections. This should work with Windows 10 or other decent host OS and create a separate HID device for each TLC. Check the report descriptors and the actual data sent for the reports. IIRC you need to use report IDs to distinguish reports sent for different TLCs (the first byte of each report is the report ID).