Typical USB connector application system consists of USB host, USB device and USB cable. In the USB bus system, external devices are generally unified as USB devices, mainly to complete specific functions, such as commonly used U disk, mobile hard disk, mouse, keyboard, gamepad, etc. The USB host is the master of the system, responsible for the control and processing of data in the USB communication process. In the USB connector transmission process, the data transmission sent from the USB host to the USB device is called downstream (Down Stream) communication, and the data transmission sent from the USB device to the USB host is called upstream (UpStream) communication.
Similar to the layered structure design of Ethernet, the bus system of USB connector also has a clear layered structure. That is, the complete USB application system can be divided into functional layer, device layer and bus interface layer.
1. Function layer. Functional layer in the USB connector application system is mainly responsible for the data transmission between the USB host and the device, by the USB device's functional unit and the corresponding USB host program. Functional layer provides for the type of data transfer, divided into the following four types: control transfer (Control Transfer), bulk transfer (Bulk Transfer), interrupt transfer (Interrupt Transfer), synchronous transfer (IsochronousTransfer).
2. Device layer. Device layer in the USB connector system is responsible for the management of USB devices, the allocation of USB device address, access to device descriptors. The work of the device layer requires drivers, USB devices and USB host support. In the device layer, the USB driver can get the ability of the USB device.
3. Bus interface layer. The bus interface layer implements the timing of USB data transfer in the USB connector system. USB bus data transfer uses NRZI encoding, which is a reverse non-return-to-zero encoding. In the USB connector bus interface layer, the USB controller automatically performs NRZI encoding or decoding to complete the data transmission process. The bus interface layer is generally done automatically by the USB interface hardware.