cancel
Showing results for 
Search instead for 
Did you mean: 

Mouse and Keyboard USB HID stm32f042

gates.nathan
Associate III
Posted on September 26, 2016 at 18:14

In separate applications I have managed to control the mouse, and the keyboard using the stm32f042. How do I go about combining the two in one application?

I would like my stm32 to be treated as both a keyboard and mouse.

Any help is much appreciated, 

Thanks
2 REPLIES 2
valentin
Senior
Posted on September 26, 2016 at 21:34

Maybe you can emulate a USB hub plus mouse & keyboard?

Kraal
Senior III
Posted on September 27, 2016 at 09:06

Hi !

Combining the 2 is easy: in the configuration descriptor you have to specify that you have 2 interfaces (1 for mouse + 1 for keyboard), and merge the 2 interfaces descriptor into the same configuration descriptor.

Don't forget to assign a different endpoint for each interface (i.e. EP1 for keyboard and EP2 for mouse).

Then you would have to put the 2 report descriptors in your source.