USBLib_FindObject (SWI &56352)

USBLib_FindObject (SWI &56352) — Obtain an object reference

On Entry

R0Pointer to the master object structure which should be searched for the object or zero if searching for an USB host controller.
R1Pointer to controller name at controller searching or device or endpoint number
R2Object type Table A.8, “Object reference types”
R3

ValueDefinitionDescription
1USB_FIND_KEEP_REFERENCEThe reference to the master object is not automatically released but kept.
2USB_FIND_NEXT_OBJECTDoes not find the USB Host controller, device or endpoint which Number or Name has been given inside R1 but the one which name or number is the next bigger one than the value given in R1. This allows enumerating of USB Host controllers, devices and endpoints.

R4Pointer to a 4 Byte word. May be set to zero if not scanning a list. The value returned inside this word if given depends on the kind of search value passed in R1. If this is an integer it will contain an integer else it will contain a pointer to 0 terminated string. This value can be used to scan list of host controllers, devices and endpoints if it is used for the next USB_FindObject call with USB_FIND_NEXT_OBJECT behaviour flag set.

The reference to the master structure is deregistered automatically if USB_FIND_KEEP_REFERENCE in the behaviour control has not been selected.

On Exit

R0-R4Preserved
R5Object or zero on error

Use

This call obtains an object or returns with V set an R0 points to an error block

Note

The returned reference will have its registration count incremented which will require freeing with USBLib_ReferenceDeregister (SWI &56372) when the reference is no longer required.

Related SWIs

USBLib_ReferenceDeregister (SWI &56372)

Related Information

Chapter 4, Endpoints and Pipes