I have a product under development that needs to send USB key codes to the PC that are outside the range that is supported by the USBD library and I am wondering the best way to go about altering the HID Keyboard descriptor.
The project implementation relies on the USBD library extensively. The USB Keyboard Descriptor is not taken from the user application; it relies on the USB HID KBD descriptor provided by the USBD library. The Logical Maximum and Usage Maximum reported by the USBD library are both 0x65. This needs to be increased to 0x73 to support keys up to F24, and I cannot determine a way to replace the built-in descriptor with my own.
From "app_usbd_hid_kbd_desc.h":
What is the "correct" way to change the USB HID KBD descriptor?
To be clear, I need to change the Logical Maximum and Usage Maximum to 0x73, instead of 0x65.
I am very reluctant to edit the content of the SDK. To edit the file within the SDK is likely to work, however it then relies on documenting changes to the SDK, should the SDK ever be changed at some point in the future. This would seem like a solution that will work today, however another developer in future would need to know that there have been changes made to the standard SDK.There is a code maintenance risk in the future.
I would prefer to define my own version of APP_USBD_HID_KBD_REPORT_DSC(), however I cannot see how to do it as the library version is used within app_usbd_hid_kbd:
At this point, I cannot see any other way to change the USB HID KBD descriptor, other than to change the file in the SDK.
Can you please help to share the correct method for changing the USB HID KBD descriptor.
SDK 17.1.0.