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

Chapter 19: USB Device Configuration

Table 19-6: Device Request to Get Device Descriptor

Request

Request

Value

Index

Length

Data

Type

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

10100000B

GET_DESCRIPTOR

Descriptor

Zero

Descrip-

Descriptor

 

(06h)

Type

 

tor

 

 

 

(01h)

 

Length

 

 

 

 

 

 

 

Device Descriptor

Table 19-7 defines the device descriptor format and definition. The following sections discuss how host software evaluates the device descriptor during the configuration process. Some fields in Table 19-7 are not discussed under the following headings since the definition of these fields is obvious and does not benefit from additional verbiage (in the judgment of the author).

Table 19-7: Device Descriptor Definition

Offset

Field

Size

Value

Description

 

 

(bytes)

 

 

 

 

 

 

 

 

 

 

 

 

0

Length

1

Number

Size of this descriptor in bytes

 

 

 

 

 

1

Descrip-

1

01

DEVICE Descriptor Type = 01h

 

torType

 

 

 

 

 

 

 

 

2

USB

2

BCD

USB Specification Release Number in

 

 

 

 

Binary-Coded Decimal (i.e., 2.00 is

 

 

 

 

0x200). This field identifies the release of

 

 

 

 

the USB specification with which the

 

 

 

 

device and its descriptors are compliant.

 

 

 

 

 

355

USB System Architecture

Table 19-7: Device Descriptor Definition

Offset

Field

Size

Value

Description

 

 

(bytes)

 

 

 

 

 

 

 

 

 

 

 

 

4

Device-

1

Class

Class code (assigned by USB).

 

Class

 

 

 

 

 

 

 

If this field is reset to zero, each interface

 

 

 

 

within a configuration specifies its own

 

 

 

 

class information and the various inter-

 

 

 

 

faces operate independently.

 

 

 

 

Values between 1 and FEh specify the

 

 

 

 

class definition for an aggregate inter-

 

 

 

 

face. This means that the device supports

 

 

 

 

different class specifications on different

 

 

 

 

interfaces and the interfaces may not

 

 

 

 

operate independently (i.e., a CD-ROM

 

 

 

 

device with audio and digital data inter-

 

 

 

 

faces that require transport control to

 

 

 

 

eject CDs or start them spinning).

 

 

 

 

If this field is set to FFh, the device class

 

 

 

 

is vendor specific.

 

 

 

 

 

5

Device-

1

Subclass

Subclass code (assigned by USB) if the

 

Subclass

 

 

field does not have a value of FFh

 

 

 

 

These codes are qualified by the value of

 

 

 

 

the DeviceClass field. If the DeviceClass

 

 

 

 

field is reset to zero, this field must also

 

 

 

 

be reset to zero.

 

 

 

 

 

356

Chapter 19: USB Device Configuration

Table 19-7: Device Descriptor Definition

Offset

Field

Size

Value

Description

 

 

(bytes)

 

 

 

 

 

 

 

 

 

 

 

 

6

Device-

1

Protocol

Protocol code (assigned by USB)

 

Protocol

 

 

 

 

 

 

 

These codes are qualified by the value of

 

 

 

 

the DeviceClass and the DeviceSubClass

 

 

 

 

fields. If a device supports class-specific

 

 

 

 

protocols on a device basis as opposed to

 

 

 

 

an interface basis, this code identifies the

 

 

 

 

protocols that the device uses as defined

 

 

 

 

by the specification of the device class.

 

 

 

 

If this field is reset to zero, the device

 

 

 

 

does not use class-specific protocols on a

 

 

 

 

device basis. However, it may use class-

 

 

 

 

specific protocols on an interface basis.

 

 

 

 

If this field is set to FF, the device uses a

 

 

 

 

vendor-specific protocol.

 

 

 

 

 

7

Max-

1

Number

Maximum packet size for endpoint zero.

 

Packet-

 

 

(Only 8, 16, 32, and 64 are valid.)

 

Size0

 

 

 

 

 

 

 

 

8

Vendor

2

ID

Vendor ID (assigned by USB).

 

 

 

 

 

10

Product

2

ID

Product ID (assigned by manufacturer).

 

 

 

 

 

12

Device

2

BCD

Device release number in binary-coded

 

 

 

 

decimal.

 

 

 

 

 

14

Manu-

1

Index

Index of string descriptor describing

 

facturer

 

 

manufacturer.

 

 

 

 

 

15

Product

1

Index

Index of product string descriptor.

 

 

 

 

 

16

Serial-

1

Index

Index of string descriptor describing the

 

Number

 

 

device’s serial number.

 

 

 

 

 

17

Num-

1

Number

Number of possible configurations.

 

Configu-

 

 

 

 

rations

 

 

 

 

 

 

 

 

357

USB System Architecture

Class Code Field

The class code may or may not be defined within the device descriptor, since some devices may have a variety of interfaces requiring different class drivers. If a device is accessible by a single device driver, then the class code will be specified in the device descriptor. If a device requires more than one class driver to control and access the device, the class codes will be defined within the interface descriptors. Their are a many examples of devices of both types and some of these examples are listed below:

Devices defined with a single class definition are characterized by a single programming interface, and may include devices such as:

Hub Device

Microphone

Speaker

Mouse

Keyboard

Devices characterized by multiple programming interfaces and different class definitions may include:

Digital USB Telephone — this device can be characterized by two different classes: audio (sender and receiver) and human interface (dialer).

CD-ROM — these devices can be characterized by several different programming interfaces that have their own device-class definition including audio, video, and mass storage. Depending on which software application is currently using the CD-ROM, a different USB class driver will be used.

Composite device — a composite device is a device that has a single interface to two distinctly different functional devices. For example, a keyboard may also have an integrated scanner and/or a USB headphone jack. Each of these devices would have its own interface descriptor that defines its device class type.

Compound device — a compound device is defined by the specification as a hub class device that integrates other functional devices. For example, a USB printer that also includes a hub.

If the device descriptor does not define a class type (class code field =00h), then the interface descriptors will define the class type for each interface being described. Note that the subclass field must also be zero if the class code field is zero.

A class code field containing FFh means that the definition of the descriptor is

358

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