USB data transmission process
The USB Bus Protocol strictly defines the data transmission. through the collaboration of software and hardware, the two-way data transmission between the USB host and the device can be conveniently realized, the communication process involves four parts: host software, USB Bus DriverProgramUSB host driver control, USB function equipment, need their support division of labor.
USB Data Structure
USB data is composed of binary numeric strings. First, a numeric string consists of seven domains: Synchronous domain, Id domain, address domain, frame number domain, data domain, and end point domain ), the domain constitutes a package (four types: token package, data packet, and handshake packet), and the package constitutes a transaction (three major transactions: in transactions, out transactions, and setup transactions are composed of three phases: token package, data packet, and handshake packet ), transaction final composition transmission (Interrupt transmission, parallel transmission, batch transmission and control transmission ).
Data transmission type selection
Use of the four data transmission modes stipulated by the USB Protocol: (1) control transmission. It is mainly used for device detection and configuration by hosts. (2) interrupted transmission. It is used to support devices that occasionally require data communication but have limited service time. Interrupted transmission is often used on devices such as keyboards, mouse, and game poles. (3) batch transmission. It is suitable for scenarios where time is not important. Batch transmission can transmit a large amount of data without blocking the bus, because it will first execute other types of transmission to wait for the transmission time, such as for disk operations. (4) synchronous transmission. It is suitable for transmission at a fixed rate and can tolerate occasional errors, such as real-time voice transmission. We first implement control transmission, but the data collection system requires a large amount of data, so we try to transfer it in batches.