USB_FastAccessInformation (SWI&55395)

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

On Entry

R0Pointer to an array of 4 Byte Words.
R10
R2Maximal number of elements inside the array.
R3Reserved. Must be set to zero.
R4Reserved. Must be set to zero.

On Exit

R0preserved
R1Error code Table A.1, “Error codes used by the USB system”
R2Number of elements inside the array which really have been filled.
R3, R4preserved

Use

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

Array elementDescription
0Pointer 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.
1Private word of the USB module
2Pointer to usb_frame_sync_number function of the of USB Module
3Pointer to usb_transaction_get_pending function of the of USB Module
4Pointer to usb_request_get_pending function of the of USB Module
5Pointer to usb_transaction_result function of the of USB Module
6Pointer to usb_request_start function of the of USB Module
7Pointer 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