USB, two devices in one (HID Mouse + Xinput gamepad)

Status
Not open for further replies.

LuisHS

Well-known member
Hello:

I have compile, with some modifications to run in Teensy 3.2, Zack source code to emulate Xinput Xbox gamepad with rumble force feedback, and work fine.

Now I need that same device may emulate two USB devices in one, so need Mouse + Xinput gamepad. I know its possible emulate at least two HID devices in one, for example Mouse + Keyboard.

The question is if its possible emulate two USB devices in same code, one is HID Mouse and other is Xinput Gamepad (not HID), and how I must config/modify source code to do it.

I do not have experience with USB about descriptors and code to mix at least two USB devices in one, but I have source code to emulate two HID devices HID Mouse + HID Keyboard, etc...

Thank you.
 
Last edited:
I think it should not matter if the USB devices are HID or not, you still should be able to combine them. But I can't help you how to do it, with current Teensies. I've done similar thing in the past, but with LUFA, that is AVR-only. I think current TeensyDuino makes that easier than with LUFA before, I just haven't studied that.

I think the code is is under Arduino, hardware/teensy/avr/cores/teensy3. Under Mac this "hardware" is located under Applications/Arduino.app/Contents/Java. I don't know where it is in other systems. And why the "avr" is in the path, Teensy3 is ARM-based, not avr :)
 
.

Ok, thank you for your reply Pazi.

If its possible mix two USB devices in same code, though one is not HID, then its good. I will do my tests and sure will work, I see some defines with IF for each USB device in source code, I suppose I must modify boards.txt to add or modify a USB device for Mouse + Xinput.

Thanks.
 
Last edited:
Status
Not open for further replies.
Back
Top