Other Parts Discussed in Thread: HID2
Tool/software:
Hello,
I'm currently working with an example keyboard project based on the MPS430, and I need some guidance on modifying the code. The project uses a consumer report to interact with Windows, and I want to change the Usage ID from an 8-bit to a 16-bit value to accommodate more usage IDs.
I’m using the original library and would like to know the best approach for handling the transition from the 8-bit to the 16-bit Usage ID.
I have currently narrowed down my modifications to the following HID2 report descriptor and associated size
#define report_desc_size_HID2 51
uint8_t const report_desc_HID2[]=
{
0x05, 0x0C, // Usage Page (Consumer)
0x09, 0x01, // Usage (Consumer Control)
0xA1, 0x01, // Collection (Application)
0x85, 0x03, // Report Id
0x75, 0x01, // Report Size (1)
0x95, 0x01, // Report Count (1)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x09, 0xE9, // Usage (Volume Increment)
0x81, 0x06, // Input(Data, Value, Relative, BitField) Bit0
0x09, 0xEA, // Usage (Volume Decrement)
0x81, 0x06, // Input(Data, Value, Relative, BitField) Bit1
0x09, 0xE2, // Usage (Mute)
0x81, 0x06, // Input(Data, Value, Relative, BitField) Bit2
0x0A, 0x94, 0x01, // Usage AL Local Machine Browser (App1)
0x81, 0x06, // Input(Data, Value, Relative, BitField) Bit3
0x0A, 0x92, 0x01, // Usage AL Calculator (App2)
0x81, 0x06, // Input(Data, Value, Relative, BitField) Bit4
0x09, 0xCD, // Usage (Play/Pause)
0x81, 0x06, // Input(Data, Value, Relative, BitField) Bit5
0x09, 0x6F, // Usage (Brightness Increase)
0x81, 0x06, // Input(Data, Value, Relative, BitField) Bit6
0x09, 0x70, // Usage (Brightness Decrease)
0x81, 0x06, // Input(Data, Value, Relative, BitField) Bit7
0xC0, // End Collection
};
When I change the from the 8 bit tag and data {0x09, 0xFF} to 16-bit {0x0A, 0x92, 0x01} on lines 17 and 19, where 0xFF is just a place holder for any Usage ID which is constrained to 8-bits. I also changed report_desc_size_HID2 from 49 to 51 to account for the two extra bytes of data in the report.
Has anyone worked with modifying the Usage ID in a similar context? Any advice or pointers would be greatly appreciated!
Thank you!