Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - USB: insertion callbacks for devices with multiple interfaces: (2 Items)
   
USB: insertion callbacks for devices with multiple interfaces  
Hi All.

I am a bit confused about support for USB devices with multiple interfaces - the short version of my question is whether
 the USB stack supports multiple concurrent interfaces on a single device?

I have used usbd_connect(), and it appears that I get an insertion callback for *each* interface of my device.

In each insertion callback I can use usbd_attach() to get a "device descriptor" - these "device descriptor"s appear to 
have unique addresses, so is that really a device descriptor, or has it (already) been tied to the interface in some way
?

Do I need to call usbd_select_interface() on each "device descriptor" ?


Re: USB: insertion callbacks for devices with multiple interfaces  
1) Yes the stack supports multiple concurrent interfaces on a single device
2) The usbd_device is a handle for the interface or device feature you are trying to access. If you have a device with 3
 interfaces and you got 3 insertion callbacks where you called usbd_attach() for each you get a unique handle for each 
interface. That's what the usbd_device is.
3) You normally use usbd_select_interface() to enable the alternative setting for a given interface, so this would 
entirely depending on your device and the functionality you are trying to use.