A USB system is described by three definitional areas:
? USB interconnect
? USB devices
? USB host
The USB interconnect is the manner in which USB devices are connected to and communicate with the host.
There is only one host in any USB system.
The USB interface to the host computer system is referred to as the Host Controller.
The Host Controller may be implemented in a combination of hardware, firmware, or software.
A root hub is integrated within the host system to provide one or more attachment points.
USB devices are one of the following:
? Hubs, which provide additional attachment points to the USB
? Functions, which provide capabilities to the system, such as an ISDN connection, a digital joystick, or speakers
Function <==> Device
USB devices are divided into device classes such as hub, human interface, printer, imaging, or mass storage
device.
All USB devices are accessed by a USB address that is assigned when the device is attached and
enumerated.
The USB transfers signal and power over a four-wire cable,The signaling occurs over
two wires on each point-to-point segment.
The cable also carries VBUS and GND wires on each segment to deliver power to devices. VBUS is
nominally +5 V at the source.
? The USB high-speed signaling bit rate is 480 Mb/s.
? The USB full-speed signaling bit rate is 12 Mb/s.
? A limited capability low-speed signaling mode is also defined at 1.5 Mb/s.
The clock is transmitted, encoded along with the differential data. The clock encoding scheme is NRZI
with bit stuffing to ensure adequate transitions. A SYNC field precedes each packet to allow the receiver(s)
to synchronize their bit recovery clocks.
In NRZI encoding, a “1” is represented by no change in level and a “0” is represented by a change in level.
All USB devices attach to the USB through ports on specialized USB devices known as hubs. Hubs have
status bits that are used to report the attachment or removal of a USB device on one of its ports. The host
queries the hub to retrieve these bits. In the case of an attachment, the host enables the port and addresses
the USB device through the device’s control pipe at the default address.
The host assigns a unique USB address to the device and then determines if the newly attached USB device
is a hub or a function.
If the attached USB device is a hub and USB devices are attached to its ports, then the above procedure is
followed for each of the attached USB devices.
If the attached USB device is a function, then attachment notifications will be handled by host software that
is appropriate for the function.
When a USB device has been removed from one of a hub’s ports, the hub disables the port and provides an
indication of device removal to the host. The removal indication is then handled by appropriate USB
System Software. If the removed USB device is a hub, the USB System Software must handle the removal
of both the hub and of all of the USB devices that were previously attached to the system through the hub.
Bus enumeration is the activity that identifies and assigns unique addresses to devices attached to a bus.
Because the USB allows USB devices to attach to or detach from the USB at any time, bus enumeration is
an on-going activity for the USB System Software.
A pipe supports only one of the types of transfers described above for any given device configuration.
A composite device has only a single device address.
A device that has multiple interfaces controlled independently of each other is referred to as a composite device.
While devices physically attach to the USB in a tiered, star topology, the host communicates with each
logical device as if it were directly connected to the root port.
An endpoint is a uniquely identifiable portion of a USB device that is the terminus of a communication flow
between the host and device.
Each endpoint on a device is given at design time a unique device-determined identifier called the endpoint
number.
The combination of the device address, endpoint number, and direction allows each endpoint to be uniquely referenced.
A USB pipe is an association between an endpoint on a device and software on the host.
Pipes represent the ability to move data between software on the host via a memory buffer and an endpoint on a device.
There are two mutually exclusive pipe communication modes:
? Stream: Data moving through a pipe has no USB-defined structure
? Message: Data moving through a pipe has some USB-defined structure
The USB System has three basic components:
? Host Controller Driver
? USB Driver
? Host Software
The Host Controller Driver (HCD) exists to more easily map the various Host Controller implementations
into the USB System, such that a client can interact with its device without knowing to which Host
Controller the device is connected.
The USB Driver (USBD) provides the basic host interface (USBDI) for clients to USB devices.
The client layer describes all the software entities that are responsible for directly interacting with USB
devices.
When a device is attached, the hub driver receives a notification from the hub detecting the change.
The hub driver, using the information provided by the hub, requests a device identifier from the USBD.
The device is now ready to be configured for use. For each device, there are three configurations that must
be complete before that device is ready for use: