2 V-USB Devices merged to a Composite Device?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Kai.n
Posts: 4
Joined: Wed Sep 02, 2009 12:34 pm

2 V-USB Devices merged to a Composite Device?

Post by Kai.n » Wed Sep 02, 2009 12:42 pm

Hey!

we got 2 V-USB driven USB-Devices, a CDC device and a costum device.
Our aim is now to get these two devices to one single composite device, but we actually don't have a real idea how :)

What we found out by now:
- We need to modify the descriptors to multiple interfaces
- We need to change the event-handler so the Packet with the right ID gets to the right Interface.

Now we have 2 problems:
- with the descriptor setting based on #define's i have no idea how to change the descriptor. Is there a way to change the descriptor directly? (well, beneath changing the lib itself ;) )

- the event-handler bases on USB_Poll, how do we get the right data to the right interface?

Maybe it should have been the first question, but is it possible using the V-USB library?
The Wiki doesn't even know the word "composite" :(

Any help will be appreciated,
Thanks,
Kai


*edit* and one more thing:
it is correct that combining them in a composite is the right way as we don't want to change ANYTHING on the drive for the costum device, is it?

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Re: 2 V-USB Devices merged to a Composite Device?

Post by christian » Tue Sep 22, 2009 10:21 am

You can replace every USB descriptor with your own version by defining USB_CFG_DESCR_PROPS_DEVICE, USB_CFG_DESCR_PROPS_CONFIGURATION and so on. You can supply your own version in flash memory or as return value from a function call.

Don't know whether you actually need a composite device, though. You can easily send your custom requests to a CDC (or whatever) class device and they will arrive in usbFunctionSetup(). Just make sure that your request IDs don't conflict with the class requests.

Post Reply