LUFA Based Multi-Device

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hai!

I have developed a test board with on it an ATMEGA16U4 and a FTDI FT232 device (working separately for testing and what-not)

(which in some stadia spawned things like a standalone force-feedback mouse skittering around a desk. Force feedback mouse? Yes! Old, but still very cool and extremely unsupported in latter-day OSs)

Anyway, this turned into me thinking about using the RS232 port for USB-based virtual com to the atmel to control a 2degrees of freedom flight-sim chair, while the USB port of the atmel could do a HID simulation for a keyboard-Joystick integrated into the chair, which also allows input/output to console lights, buttons and all this and that and whatever.
(free games all have weird ctrl-D and alt-R keys and no joystick binding for those functions)

Problem:
I'm using one PCB, but two USB ports and still would prefer the Joystick to be a Joystick device in stead of a keyboard arrow-key-simulator, without losing the idea for 24 in-cockpit-buttons. (thus spawning a 3rd USB port)

This feels unclean, so I wonder, is there anyone here (DEAN! HELP!) who knows if (and possibly how) LUFA can be used to simulate a USB-hub with 3 devices attached to it: 1 HID, 1 Joystick and 1 COM port.
Where messages get filtered per device and handled in the normal bytewise VoodooThatIDoSoWell.

Regards, salutations and eh.. thanks!

Robert!
P.S.: Dean, if this sounds like a fun thing to add to LUFA, but is not at all supported in any way yet, maybe I can assist in extending it over a few weekends, because internal-HUB function could help me greatly in future assignments as well.
I must admit I have no idea if Atmel's internal hardware allows for this, so feel free to shoot my dream-balloon down.

Embedded design is as much a life choice as any other and I demand the right to legally marry my work.
-------
If it helps, I can PM you my answer in a number of different languages. Ask if you have trouble reading my high-speed-babble in English.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't several of the LUFA examples implement two classes - I would have though extending to three classes would be feasible.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I must admit I just dove into CDC and Mass Storage half a year ago with LUFA and I did not find anything on the forum on any of my search terms.

I'll have a look.

Embedded design is as much a life choice as any other and I demand the right to legally marry my work.
-------
If it helps, I can PM you my answer in a number of different languages. Ask if you have trouble reading my high-speed-babble in English.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Emulating a hub is essentially out of the question on the AVR8 devices, due to the limitations of the controller - but you can create a "Composite" device that exposes multiple interfaces. There's a few demos in LUFA already for combining two interfaces together; the most relevant one would be Demos/Device/ClassDriver/VirtualSerialMouse which would only require you to add in the second HID interface to get the three devices you are after.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I do have to say Dean, that you are one awesome human being.
I am going to fix this up good.

Will add to "my projects" when it turns into something other than a monster bent on eating humanity.

Embedded design is as much a life choice as any other and I demand the right to legally marry my work.
-------
If it helps, I can PM you my answer in a number of different languages. Ask if you have trouble reading my high-speed-babble in English.