E.5.3.2 isochronous transfers, E.5.3.2, Isochronous transfers – Motorola USB08 User Manual

Page 184

Advertising
background image

Designer Reference Manual

USB08 Evaluation Board

184

Universal USB Device Driver (USBIO)

MOTOROLA

Universal USB Device Driver (USBIO)

A read operation will be completed if the whole buffer is filled or a short
packet is transmitted. A short packet is a packet that is shorter than the
FIFO size of the endpoint. For more information on receiving short
packets see below. To read a data packet with a length of zero, the
buffer size has to be at least one byte. A read operation with a NULL
buffer will be completed with success by the system without performing
a read operation of the USB.

The behavior of the read operation depends on the state of the flag

USBIO_SHORT_TRANSFER_OK

of the related pipe. This setting may be

changed by using the IOCTL_USBIO_SET_PIPE_PARAMETERS
(

page 179

) operation. The default state is defined by the registry

parameter

ShortTransferOk

. If the flag

USBIO_SHORT_TRANSFER_OK

is set a read operation that returns a

data packet that is shorter than the FIFO size of the endpoint is
completed with success. Otherwise, every data packet from the endpoint
that is smaller than the FIFO size causes an error.

E.5.3.2 Isochronous Transfers

For isochronous transfers the data buffer that is passed to the

ReadFile

or

WriteFile

function has to contain a header that

describes the location and the size of the data packets to be transferred.
Therefore, the buffer that follows the header is divided into packets.
Each packet is transmitted within an USB frame (normally 1 ms). The
size of the packet can be different in each frame. This allows to support
any data rate of the isochronous data stream.

The structure of the data buffer is shown in

Figure E-3

. The buffer

contains an USBIO_ISO_TRANSFER_HEADER (

page 213

) structure

of variable size at offset zero and the data packets. The header contains
an USBIO_ISO_TRANSFER (

page 210

) structure that provides general

information about the transfer buffer. An important member of this
structure is the NumberOfPackets parameter. This parameter specifies
the number of data packets contained in the transfer buffer. The
maximum number of packets that can be used in a single transfer is
limited by the registry parameter

MaxIsoPackets

. Each data packet

has to be described by an USBIO_ISO_PACKET (

page 212

) structure

Advertising