USB_FastAccessInformation (SWI&55395)
Prev | Chapter 2. Core SWI Calls | Next

## Name

USB_FastAccessInformation (SWI&55395) — Fills an array with function addresses of some USB-Module functions.

## On Entry

R0 | Pointer to an array of 4 Byte Words.
R1 | 0
R2 | Maximal number of elements inside the array.
R3 | Reserved. Must be set to zero.
R4 | Reserved. Must be set to zero.

## On Exit

R0 | preserved
R1 | Error code Table A.1
R2 | Number of elements inside the array which really have been filled.
R3, R4 | preserved

## Use

The following array will be created if there is enough space available. The array element numbering is starting with element number 0.

Array element | Description
--- | ---
0 | Pointer to USB dynamic area. This information is used by USB module internally at memory management because if USB module is not called using its own pw it won't know about this value. So it calls USB_FastAccessInformation in SWI-Mode to obtain this information.
1 | Private word of the USB module
2 | Pointer to usb_frame_sync_number function of the of USB Module
3 | Pointer to usb_transaction_get_pending function of the of USB Module
4 | Pointer to usb_request_get_pending function of the of USB Module
5 | Pointer to usb_transaction_result function of the of USB Module
6 | Pointer to usb_request_start function of the of USB Module
7 | Pointer to usb_request_get_state function of the of USB Module

During that development of the USB module is was detected that the way calling the functions of the USB module by SWIs is to slow for high rate of calls. An USB Host controller driver must call the USB module usually 5000 times per second to do the normal handling without any real traffic. Therefore the most used functions are available as direct APCS calls. The parameters of the functions are the same as given inside the C-USB development library. C-Programmers need not to worry about it because the C-Compilers will generate APCS-code so they can take the addresses inside the array as pointers to functions. Even the syntax of such calls is a little bit strange it is described in all C-Standard books. Note that there is no need to change the private word even that one of the USB module is given inside the array. Other compilers will normally produce also APCS code, so you can use the direct calls inside other languages too. In Assembler you have only to fill r0-r3 with the according parameters and doing a BL. If there are more then 4 parameters used by a function please follow the scheme described at APCS. I don't know how to use the calls directly from BASIC. But it is unlikely to write a high speed application in BASIC. You can use the normal SWIs at here. You can also include assembler in BASIC to do the calls.

## Related SWI's

None

Prev | Up | Next
USB_TransactionResult (SWI&55394) | Home | USB_EndpointInformation (SWI&55396)