USB_RequestStart (SWI&5538F)
Prev | Chapter 2. Core SWI Calls | Next

## Name

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

## On Entry

R0 | Pointer to pipe structure.
R1 | Transaction behaviour flags Table A.2
R2 | First frame after which request can be send if the USB_TRANSACTION_FRAME_START flag is set in R2, otherwise it is unused.
R3 | Pointer to data URB.
R4 | Pointer to USB Setup request URB else zero.
R5 | Pointer to waiting template.
R6 | Request timeout in centiseconds if the USB_TRANSACTION_TIMEOUT flag is set in R2, otherwise it is unused.
R7 | Reserved. Must be set to zero.

## On Exit

R0 | Pointer to new waiting structure or zero if an error occurred.
R1 | Error code Table A.1
R2, R3, R4, R5, R6, R7 | Preserved

## 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 containg 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 futher transactions queued on the pipe will execute in order and hence will not commence untill 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 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 actualy 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 tranasction result will be USB_TRANSACTION_RESULT_TIMEOUT.

The returned waiting structure is used to track the satus of the transaction and obtain its completion status. The behaviour of this tracking is controled 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 8 and Chapter 7 for more details on transactions and waiting for their completion.

## Related SWI's

USB_RequestGetState (SWI&55390)

## Related Information

Chapter 8

Chapter 7

Prev | Up | Next
USB_PipeHalt (SWI&5538E) | Home | USB_RequestGetState (SWI&55390)