usb 学习笔记

alt setting

什么是alt setting. 常常会看到文档中有提到alternative setting.下面是网上找到的通俗的解释ide


Alternate setting is used to provide the advantage of having two configuration on the fly even though the device has only one configuration.spa

The alternate setting of a USB interface is define by the bAlternativeSetting attribute in the device descriptor. AUSB interface with an alternate settings can be used in two mode. For example aUSB interface endpoints may act as INTERRUPT pipes in normal settings, but might act asBULK pipe in alternate settings providing you the facility of two different mode on the same interface. You just have to send aSetInterface request to activate a settings. I myself didn't have to use it much though. And I think normally device drivers don't tend to use it as I couldn't find out any example driver.code


以下图, interface one能够有两个功能,区别两个功能就是经过Alternate setting。orm

Interface descriptors have a bInterfaceNumber field specifying the Interface number and abAlternateSetting which allows an interface to change settings on the fly.blog