USB_EndpointRegister (SWI &55380)

USB_EndpointRegister (SWI &55380) — Installs a new endpoint for a given device.

On Entry

R0Pointer to device structure
R1Endpoint number Table 1.5, “Bits of endpoint address”
R2Transfer type Table A.5, “Constants used for type of USB transfer”
R3Data payload size
R4Number of frames that must pass until the next requests can be sent/received
R5Reserved. Must be set to zero.
R6Reserved. Must be set to zero.

On Exit

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

Use

A reference to the new endpoint structure is registered automatically if call is successful. The reference to the device structure is deregistered automatically in every case.

The parameters passed to this function must correspond to that which can be obtained for an endpoint of an USB device by getting an endpoint descriptor for that device and which are corresponding to the actual configuration of this device.

This call is normally used only internally when a configuration for a device has been set, which requires endpoints using this configuration to be established. For every registered device a default pipe must be registered.

Note that an endpoint may either input or output or both directions. This selection is done by passing a long endpoint number to the functions. You must also pass the transfer type of the endpoint and some parameters describing the transfer type in more detail.

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

Related SWI's

USB_EndpointDeregister (SWI&55381)