usb four transfer modes bulk

When plugged into the USB bus USB, USB controller to designate the device for automatically dispensing a USB device number. In addition, each endpoint device has a number to indicate the endpoint.
Each transmission USB device driver to drive the USB controller is called a transaction request (the Transaction), there are four types of transaction, namely Bulk Transaction, Control Transaction, Interrupt Transaction and Isochronous Transaction. Every transaction decomposed into a number of data packets transmitted on the USB bus. After each transmission must be two or three parts, the first USB controller issues a command to the USB device, the second part is the read and write requests passed between the USB controller and a USB device, which mainly depends on the direction of the first portion is the command read or write, the second part sometimes can not. The third part is the handshake. For the following four transmissions, respectively, to explain.

1. Bulk transfer transaction

As the name suggests, the main switching to transmit transaction data chunk is, this transaction is called pipelining Bulk pipe. When this transaction transmission divided into three parts, as shown in FIG 17-10. The first part is the token request end sends a Host Bulk, and if the token is an IN request is a request from the Host to the Device, if the OUT token, a request from the Host to the Device terminal.
The second part is the data transfer phase, depending on the type previously requested token, there may be data transfer direction IN, OUT direction is also possible. When the transmission data carrying data DATA0 and DATA1 tokens transmitted alternately.

The third part is the handshake. If the direction of data IN, handshake signals should be sent Host side, if the OUT direction side Device handshake signals should be sent. Handshaking signal may be an ACK, indicating a normal response, it may be expressed not correctly transmitted NAK. STALL indicates an error host unpredictable appear.
In the second part, i.e. when the transmission of data packets, transmitted from the data transmission DATA0 and DATA1 packets alternate. DATA0 and DATA1 format data transfer, two data is repeated to ensure that 0 1 mended when data loss, data loss will not. Shown in Figure 17-11.

 
(Click to enlarge) Figure 17-10 Bulk transport
 
FIG token 17-11 Bulk transport

2. Control transfer transaction

Transmission control is responsible for setting some control information to USB, this transfer transaction pipeline is to control the pipeline. In each USB device will have control of the pipeline, which means that the pipeline control is necessary in the USB device. Transmission control is also divided into three phases, namely the token phase, the data transfer phase, handshake phase, as shown in FIG 17-12.

 
FIG transfer transaction control 17-12

3. Interrupt transfer transaction

In the USB device, a kind of interrupt handling mechanism similar to the mechanism of PCI, which is interrupted transaction. The amount of data interrupt transaction is very small, typically used to notify the arrival of Host an event, such as a USB mouse, move the mouse or mouse click events and other operations will be transferred to the Host via an interrupt pipe. In the interrupt transaction, but also divided into three stages, namely the token phase, the data transfer phase, handshake phase, as shown in Figure 17-13.

 
(Click to enlarge) Figure 17-13 interrupt transfer transaction

4. Synchronous Transport Services

There is also a USB device called synchronous transfer transaction transaction, such a transaction can ensure the synchronization of transmission. For example, video data is transmitted at the time the USB camera will use this transaction, the transaction can be guaranteed a fixed amount of transmission per second, but different from Bulk transmission, which allows a certain error rate, so that compliance with video conferencing demand transmission, video conferencing because first of all to ensure real-time, under certain conditions, allow a certain error rate. Synchronous transfer transaction there are only two stages, i.e. the token phase, data phase, because the do not care about the correctness of the data, so there is no handshake phase, as shown in FIG 17-14.

 

Guess you like

Origin www.cnblogs.com/hshy/p/11728333.html