Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
USB System Architecture (USB 2.0).pdf
Скачиваний:
172
Добавлен:
03.05.2015
Размер:
7.03 Mб
Скачать

USB System Architecture

Set/Get Configuration

Host software configures a device by selecting one of the configurations defined within the device’s descriptors and assigning the corresponding 8-bit configuration value to the device. The “Set Configuration” request is used by software to assign the configuration value. Conversely, software may inquire which configuration has been assigned to a device, using the “Get Configuration” request. Note that the configuration value is transferred during the data stage of the control transfer.

Set/Get Descriptor

Device descriptors are read using the “Get Descriptor” request. The optional “Set Descriptor” request is supported by devices that provide a way to add new or update existing descriptors. In either instance, a specific descriptor and an index within the descriptor can be targeted. The standard “Set/Get Descriptor” requests support only the device, configuration, and string descriptors. Each of these descriptors has an associated value that defines the descriptor type as shown in Table A-5. The interface and endpoint descriptors can only be read via the Get Configuration Descriptor request and are returned following the selected configuration descriptor.

Host software initially accesses the device descriptor to determine the maximum data payload that a device’s default control pipe supports. The device descriptor specifies the maximum data payload supported by the default control pipe (endpoint 0). Host software can determine the maximum payload for endpoint 0 by issuing a “Get Descriptor” request with the values shown in Table A-4. The high byte within the “value” field contains the descriptor type (01=device descriptor), and the low byte contains the descriptor index. The device will return the contents of the device descriptor starting at the index specified. The descriptor contents are returned during the data stage of the control transfer.

440

Appendix A: Standard Device Requests

Table A-4: Contents of Setup Transaction During Get Descriptor Requests

Request

Request

Value

Index

Length

Data

Type

(2 bytes)

(2 bytes)

(2 bytes)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

10000000B

GET_DESCRIPTOR

01h = Device

Zero or

Descriptor

Descriptor

 

(06h)

Descriptor

Language

Length

Contents

 

 

07h = Index

ID

 

 

 

 

 

 

 

 

Note that if a string descriptor is specified, the index value will contain the language ID. For all other descriptor types the index is cleared (zeros).

Table A-5: Descriptor Types That Can Be Specified via Standard Get/Set Descriptor Request

Descriptor Types

Value

 

 

 

 

DEVICE

1

 

 

CONFIGURATION

2

 

 

STRING

3

 

 

Set/Get Interface

The “Set” and Get Interface” requests are used to specify alternate settings to be used in some selected configurations. That is, some devices may have an interface that contains mutually exclusive settings. In this case, the interface descriptor will provide a value used to select the alternate setting. The setting must be selected using the Set Interface” request. The host can determine which alternate setting has been selected by using the Get Interface” request.

441

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]