USB System Structure

Source: Internet
Author: User


USB System Structure

1. USB system topology

The topology of the USB system consists of the USB host controller, root hub, hub, and device. The root hub is bound with the USB host controller.

 

 

Node represents a USB device. in a broad sense, hub is also a USB device. A usb bus can mount up to 127 devices.

Common USB master controllers:

OHCI (Open Host Controller Interface): it is mainly a non-PC system USB chip and a common controller for embedded systems. USB1.1

Uhci (Open Host Controller Interface): Mostly USB controller chips on Intel and via boards. USB1.1

EHCI (enhanced Host Controller Interface): it is developed by several vendors such as Intel and is compatible with OHCI \ uhci and complies with the USB2.0 specification.

 

2. USB implementation framework:

 

3. a USB device consists of configuration, interface, and endpoint.


 

1. A device usually has one or more configurations.

2. Configuration often has one or more interfaces

3. An interface usually has one or more settings.

4. The interface does not have or has more than one endpoint

Configuration is composed of interfaces. Each device has different levels of configuration information;

An interface consists of multiple endpoints, representing a basic function;

An endpoint is the only addressable part of a USB device and can be understood as a data buffer zone on a USB device or host.

Understanding of configuration and settings: A mobile phone can have multiple configurations. For example, a phone can be connected to a PC and a USB flash drive. These two scenarios are different configurations. Let's take a look at the settings. A mobile phone number has been determined, but the call scenario (outdoor mode, meeting mode, etc.) can be changed, and each scenario can be considered as a setting.

 

For example, a USB Player includes audio, video, knob, And button.

Configuration 1: audio (Interface) + knob (Interface)

Configuration 2: audio (Interface) + video (Interface) + knob (Interface)

Configuration 3: Video (Interface) + knob (Interface)

Each interface requires a driver.

Each USB device has a unique address, which is allocated by the host when the device is connected to the host, and each endpoint of the device has a unique endpoint number inside the device, this endpoint number is given during device design. Each endpoint is a simple connection point and is unidirectional.

Endpoint 0 is a special endpoint for device enumeration and some basic control functions for devices. Except for endpoint 0, other endpoints cannot communicate with the host before the device is configured. They can be activated only after the characteristics of these endpoints are reported to the host and confirmed.

For example:

USB bus, similar to highways;

The data sent and received is similar to that of a car;

USB endpoint, similar to the entrance or exit of the Highway Toll Station.

 

4. USB descriptor

When a USB device is inserted into the host system, the host system will automatically detect information about the USB device, which is implemented through the USB descriptor.

The standard USB device has five USB descriptors:

Device descriptor

Configuration Descriptor

Interface Descriptor

Endpoint Descriptor

String Descriptor

A device has only one device descriptor, while a device descriptor can contain multiple configuration descriptors. A Configuration descriptor can contain multiple interface descriptors, and an interface uses several endpoints, there are several endpoint descriptors.

 

The pipe is the connection channel between the USB device's endpoint and the host's cache. The host and the USB device communicate through the pipe.

 

5. Four transmission types

There are four different types of Endpoints: control, batch, and so on.

Corresponding to four different USB transmission types:

1. control transmission: Suitable for a small amount of devices that do not require transmission time and speed. For example, USB device configuration information.

2. batch transmission: Suitable for devices with high transmission volumes, such as printers and scanners, but with no requirements on transmission time and speed.

3. equi-time transmission: suitable for large volumes of data with a constant rate and periodic data that require real-time performance, such as audio and video.

4. interrupted transmission: applicable to non-large volumes of data with periodic characteristics, such as the mouse and keyboard. When a USB host requires a device to transmit data, the interrupt endpoint transmits data at a fixed rate. Mouse, keyboard, and game handle. This type of interruption is different from the hardware interruption that is often said, and the interruption will query the USB device at a fixed interval.

 

Three transaction types

A single transmission is composed of one or more transactions.

1. In transaction

The in transaction serves the input of the host. When the host needs to obtain data from the device, the in transaction is required.

2. Out transaction

The out transaction is the host output service. When the host needs to output data to the device, the out transaction is required.

3. Setup transaction

The setup transaction is the Host Control Service. When the host wants to transmit some default USB operations, you need to use the setup transaction.

 

Four Package Types

A transaction is composed of one or more packages, which can be divided into the setup, Data, ack, and special packets.

 

Domain

A package consists of multiple domains, which can be divided into synchronization domain (Sync), Id domain (PID), address domain (ADDR), and end point domain (endp ), frame number domain (FRAM), data domain (data), verification domain (CRC ).

 

Packet Capture:

 

Reference: http://blog.csdn.net/woshixingaaa/article/details/6362603

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.