USB_DeviceRegister (SWI&55382)

USB_DeviceRegister (SWI&55382) — Register a device

On Entry

R0Pointer to USB host controller driver structure
R1Pointer to unique device number. See below.
R2Device speed Table A.6, “Constants used for device speed”
R3Reserved. Must be set to zero.
R4Reserved. Must be set to zero.

On Exit

R0Pointer to endpoint structure
R1Error code Table A.1, “Error codes used by the USB system”
R2, R3, R4Preserved

Use

The reference to the USB host controller driver structure is deregistered automatically in every case.

A reference to the new device structure is registered automatically if call is successful.

You are able to pass a pointer to a given unique device number in the range from 0 to USB_DEVICE_MAX or this number is selected automatically if you are passing USB_DEVICE_AUTO_NUMBER. In this case the number will be written back into the value your pointer is pointing to. You must also determine the speed of a device.

If successful a pointer to the new device structure will be returned. If the call is not successful a NULL pointer and an according error code will be returned.

This call is normally used only internally by the USB-Hub driver module when a device has been connected.

Related SWI's

USB_DeviceDeregister (SWI&55383)