Introduction to USB--Part IV, Page 3.
USB DATA FLOW MODEL
Figure 1-25 shows a graphical representation of the data flow model.
F1-25(1) The host software uses standard requests to query and configure the device using the default pipe. The default pipe uses endpoint zero (EP0).
F1-25(2) USB pipes allow associations between the host application and the device’s endpoints. Host applications send and receive data through USB pipes.
F1-25(3) The host controller is responsible for the transmission, reception, packing and unpacking of data over the bus.
F1-25(4) Data is transmitted via the physical media.
F1-25(5) The device controller is responsible for the transmission, reception, packing and unpacking of data over the bus. The USB controller informs the USB device software layer about several events such as bus events and transfer events.
F1-25(6) The device software layer responds to the standard request, and implements one or more USB functions as specified in the USB class document.
The notion of transfer completion is only relevant for control, bulk and interrupt transfers as isochronous transfers occur continuously and periodically by nature. In general, control, bulk and interrupt endpoints must transmit data payload sizes that are less than or equal to the endpoint’s maximum data payload size. When a transfer’s data payload is greater than the maximum data payload size, the transfer is split into several transactions whose payload is maximum-sized except the last transaction, which contains the remaining data. A transfer is deemed complete when:
- The endpoint transfers exactly the amount of data expected.
- The endpoint transfers a short packet, that is a packet with a payload size less than the maximum.
- The endpoint transfers a zero-length packet.
DATA PACKET SIZE, TYPES, AND SPEED
Endpoints have several attributes in addition to their type, one of them being the maximum quantity of data that the endpoint can provide or consume in a single transaction.
A single transfer can involve less than the maximum quantity of data an endpoint can handle.
NEXT: Transactions, Transfers, and Frames
µC/USB Device: Universal Serial Bus Device Stack for the Renesas RX63N, Chapter 2, by Christian Legare, is excerpted with permission. The text is available at Micrium.