Search code examples
interfaceusbendpointalternate

Why would I want a USB alternate interface with no endpoints?


The example code that Atmel gives for USB devices has an interface with two alternate settings. The first one has no endpoints, the second has 6 endpoints. Is there any reason for this - why not just have one alternate setting with all the endpoints?

I found a vague post somewhere on the internet suggesting it might be something to do with power saving. Does anyone have any idea?


Solution

  • Ah so it seems like it is because an interface with isochronous endpoints reserves bandwidth on the USB bus. But having a default alternate with no isochronous endpoints you avoid that issue.

    Sources:

    http://www.makelinux.net/ldd3/chp-13-sect-1

    The initial state of a interface is in the first setting, numbered 0. Alternate settings can be used to control individual endpoints in different ways, such as to reserve different amounts of USB bandwidth for the device. Each device with an isochronous endpoint uses alternate settings for the same interface.

    https://msdn.microsoft.com/en-us/library/windows/hardware/jj124028(v=vs.85).aspx

    This test verifies that when any device has an interface that consumes isochronous bandwidth, that device supports multiple alternate settings for that interface, and that alternate setting 0 (zero) does not consume isochronous bandwidth.