Reputation: 11
I recently got an Arduino Leonardo, and I'm fascinated by its ability to emulate USB HIDs.
But from what I can see, there are only libraries for keyboard and mouse emulation.
Is it possible to make it emulate a printer, microphone, headphones, anything other than a mouse or keyboard?
Upvotes: 1
Views: 5373
Reputation: 70
It is possible to emulate any HID device with Arduino Leonardo, Pro Micro or their clones. It is not possible though with the stock Arduino HID library because it supports only SendReport method (Interrupt pipe), while generic HID support requires SetFeature/GetFeature methods (Control pipe).
Without going too deep into the theory of HID protocol implementation, you may check the emulation of the HID-compliant UPS on Arduino and implement something similar for any device class.
Upvotes: 0
Reputation: 2827
You can use the LUFA toolchain to build much more than a few Leo examples.
Upvotes: 0
Reputation: 180878
Yes, assuming that the device is HID compliant. You would just need to simulate the signals.
That said, it's unlikely that these other devices are HID compliant. They might, however, be class-compliant. Class-compliant means that you don't need special Windows drivers to plug it in and use it. There are a number of devices that are class-compliant; here is an example.
In the case of your Leonardo, it does not appear to be generally class-compliant, but more specifically HID compliant. I suppose, however, that you could write a driver on the Leonardo to make it class-compliant (for some other class).
See Also
USB Device Classes
Upvotes: 4