obdev / v-usb

A Firmware-Only USB implementation for Atmel's AVR Microcontrollers
1.22k stars 244 forks source link

Is a USB Hub implementation with multiple HID devices possible with V-USB alone? #29

Closed RobertDaleSmith closed 3 years ago

RobertDaleSmith commented 3 years ago

I built a video game controller adapter that uses USB for firmware updates (micronucleus bootloader) and converts Super Nintendo controllers to 3DO.

I thought it would be really cool if the adapter also could act as a USB joypad when the main application is active. My hardware has two Super Nintendo Controller inputs, so I was curious about how I could implement multiple HID devices simultaneously.

Is this even possible and does a USB hub code example exist?

con-f-use commented 3 years ago

HID specification supports the device acting as multiple devices, i.e. a mouse, controller and keyboard, you just have to use the right HID-descriptor. v-usb however, cannot act as a hub, it's a client only.

RobertDaleSmith commented 3 years ago

Okay cool. So I should be able to use V-USB to make a single device appear as many. But simulating a USB hub is no the right approach I guess.