USB_RequestStart (SWI&5538F)

USB_RequestStart (SWI&5538F) — Starts a transaction on the specified pipe.

On Entry

R0Pointer to pipe structure.
R1Transaction behaviour flags Table A.2, “Transaction behaviour flags”
R2First frame after which request can be send if the USB_TRANSACTION_FRAME_START flag is set in R2, otherwise it is unused.
R3Pointer to data URB.
R4Pointer to USB Setup request URB else zero.
R5Pointer to waiting template.
R6Request timeout in centiseconds if the USB_TRANSACTION_TIMEOUT flag is set in R2, otherwise it is unused.
R7Reserved. Must be set to zero.

On Exit

R0Pointer to new waiting structure or zero if an error occurred.
R1Error code Table A.1, “Error codes used by the USB system”
R2, R3, R4, R5, R6, R7Preserved

Use

This call starts a transaction to transfer data between the host and the device. The direction and specific device are determined by the pipe used.

If a control pipe is used the driver must provide a URB containing a properly formated USB control message, which is always passed in R4. A transaction on the control pipe may specify an additional URB, care should be taken as the formatted control message structure is always passed in R4 and either NULL or the additional URB passed in R3. Control messages can transfer data in either direction (to or from the device) as determined by the RequestType field in the control message structure.

If USB_TRANSACTION_FRAME_START is set in the transaction control flags the transaction will commence on or after the frame number specified in R2. Note that any further transactions queued on the pipe will execute in order and hence will not commence until after the transaction which is waiting for its specified frame number.

If USB_TRANSACTION_EXACT_SIZE is set the transaction behaviour is changed (see Table A.2, “Transaction behaviour flags” for exact definitions) this may be used by drivers so transactions complete with an error if an exact number of bytes are not transfered alternatively the driver may simply choose to check how much data was actually transfered upon completion and perform action itself. There are also some minor implications for zero length transfer generation on control pipes.

If USB_TRANSACTION_TIMEOUT is set the transaction will be abandoned if it does not complete within the specified timeout. The timeout is in centiseconds. If the transaction is terminated by the timeout the transaction result will be USB_TRANSACTION_RESULT_TIMEOUT.

The returned waiting structure is used to track the status of the transaction and obtain its completion status. The behaviour of this tracking is controlled by the "template" waiting structure passed to the call. The progress of the transaction should be checked with USB_RequestGetState (SWI&55390). Please see Chapter 7, Transactions and Chapter 6, Waiting for more details on transactions and waiting for their completion.

Related SWI's

USB_RequestGetState (SWI&55390)

Related Information

Chapter 7, Transactions

Chapter 6, Waiting