USB_EndpointRegister (SWI &55380) — Installs a new endpoint for a given device.
R0 | Pointer to device structure |
R1 | Endpoint number Table 1.5, “Bits of endpoint address” |
R2 | Transfer type Table A.5, “Constants used for type of USB transfer” |
R3 | Data payload size |
R4 | Number of frames that must pass until the next requests can be sent/received |
R5 | Reserved. Must be set to zero. |
R6 | Reserved. Must be set to zero. |
R0 | Pointer to endpoint structure or 0 on error. |
R1 | Error code Table A.1, “Error codes used by the USB system”. |
R2, R3, R4 | Preserved. |
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.