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

Chapter 19: USB Device Configuration

Table 19-11: Interface Descriptor Definition

Offset

Field

Size

Value

Description

 

 

(bytes)

 

 

 

 

 

 

 

6

Interface-

1

Subclass

Subclass code (assigned by USB). These codes are

 

Subclass

 

 

qualified by the value of the InterfaceClass field.

 

 

 

 

If the InterfaceClass field is reset to zero, this field

 

 

 

 

must also be reset to zero. If the InterfaceClass field

 

 

 

 

is not set to 0xFF, all values are reserved for assign-

 

 

 

 

ment by USB.

 

 

 

 

 

7

Interface

1

Protocol

Protocol code (assigned by USB). These codes are

 

Protocol

 

 

qualified by the value of the InterfaceClass and the

 

 

 

 

InterfaceSubClass fields. If an interface supports

 

 

 

 

class-specific requests, this code identifies the pro-

 

 

 

 

tocols that the device uses as defined by the specifi-

 

 

 

 

cation of the device class.

 

 

 

 

If this field is reset to zero, the device does not use a

 

 

 

 

class-specific protocol on this interface. If this field

 

 

 

 

is set to 0xFF, the device uses a vendor-specific pro-

 

 

 

 

tocol for this interface.

 

 

 

 

 

8

Interface

1

Index

Index of string descriptor.

 

 

 

 

 

Endpoint Descriptors

The endpoint descriptor defines the actual registers that are implemented within a given device. Table 19-12 on page 368 shows the format and definition of an endpoint descriptor. These descriptors define the capabilities of each register and specify information such as the:

type of transfer required by this endpoint

direction of the transfer (IN or OUT)

bandwidth needed

polling interval

For periodic endpoint types, configuration software must determine if the USB can support the endpoint based on its bandwidth requirements (specified in the MaxPacketSize field). If the endpoint bandwidth requirements exceed the capabilities of the USB, then the device is not configured and the user is notified.

367

USB System Architecture

Note that in some cases two or more descriptors may be used to describe a single register. For example, if an input/output register is implemented within the device, endpoint descriptors must be created for transferring data in both directions unless the endpoint is defined as a control endpoint. Control transfers are the only USB transfers that support bidirectional data flow. All other transfers are defined as unidirectional.

For example, if an input/output register is used to transfer information to and from a mass storage device, the register must have two corresponding endpoints: one for transferring data to the register and one for reading data from the register. Based on these two endpoint descriptors, configuration software will establish an IN bulk communications pipe and a separate OUT bulk communications pipe for the mass storage device class driver to use.

The values in the attribute and interval fields are discussed in the respective chapters that cover LS/FS and HS transfer types. See Chapter 6, entitled "LS/FS Transfer Types & Scheduling, " on page 117 and Chapter 12, entitled "HS Transfers, Transactions, & Scheduling, " on page 241.

Table 19-12: Endpoint Descriptor Definition

Offset

Field

Size

Value

 

Description

 

 

 

 

 

 

 

 

 

 

0

Length

1

Number

Size of this descriptor in bytes.

 

 

 

 

 

1

DescriptorType

1

Constant

Endpoint descriptor type = 05h.

 

 

 

 

 

2

EndpointAd-

1

Endpoint

The address of the endpoint on the USB

 

dress

 

 

device described by this descriptor. The

 

 

 

 

address is encoded as follows:

 

 

 

 

Bit 0:3 the endpoint number

 

 

 

 

Bit 4:6 reserved, reset to zero

 

 

 

 

Bit 7

direction, ignored for Control

 

 

 

 

 

endpoints

 

 

 

 

 

0 = OUT endpoint

 

 

 

 

 

1 = IN endpoint

 

 

 

 

 

 

368

Chapter 19: USB Device Configuration

Table 19-12: Endpoint Descriptor Definition

Offset

Field

Size

Value

 

Description

 

 

 

 

 

 

 

 

 

 

3

Attributes

1

Bitmap

This field describes the endpoint’s

 

 

 

 

attributes when it is configured using the

 

 

 

 

ConfigurationValue.

 

 

 

 

Bits 0:1

Transfer Type

 

 

 

 

00

Control

 

 

 

 

01

Isochronous

 

 

 

 

10

Bulk

 

 

 

 

11

Interrupt

 

 

 

 

Bits 3:2

Synchronization Type

 

 

 

 

00

No Synchronization

 

 

 

 

01

Asynchronous

 

 

 

 

10

Adaptive

 

 

 

 

11

Synchronous

 

 

 

 

Bits 5:4

Usage Type

 

 

 

 

00

Data endpoint

 

 

 

 

01

Feedback endpoint

 

 

 

 

10 Implicit feedback data EP

 

 

 

 

11

Reserved

 

 

 

 

Bits 7:6 Reserved (must be zero)

 

 

 

 

 

 

369

USB System Architecture

Table 19-12: Endpoint Descriptor Definition

Offset

Field

Size

Value

 

Description

 

 

 

 

 

 

 

 

 

 

 

MaxPacketSize

2

Number

Maximum packet size this endpoint is

 

 

 

 

capable of sending or receiving when this

 

 

 

 

configuration is selected.

 

 

 

 

For isochronous endpoints, this value is

 

 

 

 

used to reserve the bus time required for

 

 

 

 

the per frame data payload. The pipe may

 

 

 

 

use less bandwidth than reserved. The

 

 

 

 

device reports, if necessary, the actual

 

 

 

 

bandwidth used via its normal, non-USB

 

 

 

 

defined mechanisms.

 

 

 

 

Definition of bits:

 

 

 

 

Bits 10:0 Maximum packet size

 

 

 

 

Bits 12:11 Add transactions/ frame

 

 

 

 

00 None (1 transaction/ frame)

 

 

 

 

01

1 additional transaction

 

 

 

 

10

2 additional transactions

 

 

 

 

11 Reserved

 

 

 

 

Bits 15:13 Reserved (must be zero)

 

 

 

 

 

 

370

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