Information Technology Reference
In-Depth Information
specific USB transfer type. The number of available endpoints and sup-
ported transfer types vary with the device controller. A mass-storage device
must have one IN endpoint and one OUT endpoint in addition to end-
point zero.
Transfer Types
One reason why USB is suitable for a wide range of devices is its support for
four types of data transfers.
Control transfers enable the host to learn about a device, set a device's
address, and select configurations and other settings. Control transfers can
also send vendor-specific requests that transfer data for any purpose. All
USB devices must support control transfers. A control transfer has two or
three stages. In the Setup stage, the host sends a request. In the Data stage,
the host or device sends data. Some requests don't have a Data stage. In the
Status stage, the receiver of data in the Data stage returns status information.
If there is no Data stage, the device returns the status information.
The other transfer types don't have stages. A class specification or ven-
dor-specific protocol determines the length of a transfer. Bulk transfers are
intended for situations where the rate of transfer isn't critical. If the bus is
very busy, bulk transfers are delayed, but if the bus is otherwise idle, bulk
transfers are the fastest. Mass-storage devices use bulk transfers. Interrupt
transfers are for devices that must receive or send data periodically.
Mass-storage devices rarely use interrupt transfers except for some full-speed
floppy drives, which use interrupt transfers to report the status of a received
command. Isochronous transfers have guaranteed delivery time but no error
correcting. Mass-storage devices don't use isochronous transfers.
Transactions
Each transfer consists of one or more transactions. Each transaction contains
a token packet, a data packet, and a handshake packet. (The handshake
packet isn't present in isochronous transfers.) Each packet begins with a
packet ID (PID). The function of the PID varies with the packet type.
The token packet contains the device address and the endpoint number the
transaction is directed to. The token packet's PID identifies the packet as
one of these types: SETUP (first packet in a control transfer), OUT (other
Search WWH ::




Custom Search