1 Reply Latest reply on Nov 8, 2019 9:46 PM by EktaN_26

    USB HID: Adding a Boot Keyboard to a Keyboard/Mouse composite device?


      Hello Everyone,


      I have a PSoC5LP based USB Composite Device (HID Keyboard and Mouse) that I'm working on.  One of the problems I've run into is that I require the keyboard to be functional in BIOS of the host PC.  From what I can gather, I need to create a second Keyboard HID descriptor that conforms to the Boot Interface.  Creating a new HID descriptor is no problem, but I'm not sure where in my overall Device Descriptor this new HID device should go?  Is it it's own entirely new device that requires its own endpoints?  Can I just create a new "Alternate Setting" under the keyboard interface to be used on boot?


      My descriptor tree is below:

      Here's what I think adding the boot keyboard should maybe look like:


      Is this the right track?  Do the Boot Keyboard settings and Custom HID Keyboard settings need to use different endpoints or can they both use EP1 and the host will switch between them?  Do I need to handle this switch from the Boot Keyboard to the Custom Keyboard in firmware?  or will the USBFS component handle it for me with no intervention needed from my code?


      If this were a normal keyboard, It looks like I could simply change the keyboard subclass to "Boot Interface Subclass" and call it a day, but in the OS the keyboard must support additional keycodes beyond the standard 101/104.  From my understanding extended keycodes are incompatible with the Boot Interface, so simply changing the Custom HID Keyboard to a Boot Device would probably cut those extended codes out, so that option is out.


      If anyone out there has some knowledge of USB could chime in, it would be greatly appreciated.



        • 1. Re: USB HID: Adding a Boot Keyboard to a Keyboard/Mouse composite device?



          In case of a multi-function device you can create different interface for each of the configuration (function of the device) of the device. A device could have 1 or many interface descriptors active at a time. For example, if a USB device with functions A, B and C exists then you can create three Interface descriptors for each of the functions. Also, there is no limitation as to having only on interface active at a time.


          We create different alternate settings for an interface descriptor when an interface can be used in two modes (one at a time). USB interface endpoints may act as interrupt pipes in normal settings, but might act as Bulk pipe in alternate settings providing you the facility of two different mode on the same interface.


          Therefore you can either add interface descriptor if the two functions are active at the same time or an alternate setting within the same interface descriptor if you are switching the modes of the device.


          An endpoint is not shared among different interfaces within a single configuration, although a single interface can have several alternate settings which may use the same endpoints.


          Best Regards