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

Chapter 19: USB Device Configuration

Configuration Descriptors

Software reads a configuration descriptor to obtain global information regarding a given configuration option. The following sections discuss the fields that configuration software probes to determine configuration characteristics. Refer to Table 19-9 on page 362 during the following discussions.

Number of Interfaces

As discussed previously, a given device may have two or more interfaces that require different device class drivers. An interface consists of a collection of endpoints through which a given device driver would control and communicate with its device. The NumInterfaces field specifies the number of interfaces that are implemented in this configuration.

Configuration Value

Once configuration software has selected one of the configurations defined by the device, the device must be configured. Each configuration descriptor has a unique configuration value that is used to configure the device. Until the configuration value is written to the device, it will not consume more than 100ma of current and is not fully operational.

System software configures a device by using the Set Configuration request. The configuration value is specified within the “value” field of the setup transaction during the Set Configuration request. Refer to Table A-2 on page 438. Once configured, the device takes on the characteristics defined by the selected configuration.

Attributes and Maximum Power

The configuration attributes define how a device is powered and if it supports remote wakeup. A device configuration reports whether the configuration is bus-powered or self-powered. Device status reports whether the device is currently self-powered. If a device is disconnected from its external power source, it updates device status to indicate the device is no longer self-powered.

A device may not increase its power draw from the bus when it loses its external power source beyond the amount of bus power specified in its configuration descriptor.

361

USB System Architecture

If a device can continue to operate when disconnected from its external power source, it continues to do so. If the device cannot continue to operate, the device will fail operations that it can no longer support. Host software may determine the cause of the failure by checking status and noting the loss of the device’s power source. This information is available via the “Get Status” request (see “Device Status” on page 442 for details).

Table 19-9: Configuration Descriptor Definition

Offset

Field Name

Size

Value

 

Description

 

 

(bytes)

 

 

 

 

 

 

 

 

 

 

 

 

 

0

Length

1

Number

Size of this descriptor in bytes.

 

 

 

 

 

1

DescriptorType

1

02

Configuration value = 02h.

 

 

 

 

 

2

TotalLength

2

Number

Total length of data returned for this config-

 

 

 

 

uration. Includes the combined length of all

 

 

 

 

descriptors (configuration, interface, end-

 

 

 

 

point, and class or vendor specific) returned

 

 

 

 

for this configuration.

 

 

 

 

 

4

NumInterfaces

1

Number

Number of interfaces supported by this con-

 

 

 

 

figuration.

 

 

 

 

 

 

5

Configuration-

1

Number

Value to use as an argument to Set Configu-

 

Value

 

 

ration to select this configuration.

 

 

 

 

 

6

Configuration

1

Index

Index of string descriptor describing this

 

 

 

 

configuration.

 

 

 

 

 

7

Attributes

1

Bitmap

Configuration characteristics

 

 

 

 

D7 Reserved (must be set to 1)

 

 

 

 

 

(Bus Powered in 1.x)

 

 

 

 

D6

Self Powered

 

 

 

 

D5

Remote Wakeup

 

 

 

 

D4:0 Reserved (reset to 0)

 

 

 

 

A device configuration that uses power

 

 

 

 

from the bus and a local source must have a

 

 

 

 

non-zero value in the MaxPower field.

 

 

 

 

If a device configuration supports remote

 

 

 

 

wakeup, D5 is set to one (1).

 

 

 

 

 

 

362

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