Start an asynchronous interrupt transfer .
int32_t UsbInterruptXferAsynch(
int32_t udev,
uint32_t pipe,
void *data,
int32_t len,
uint32_t flags,
uint32_t interval,
uint32_t timeout,
RTHANDLE mbx,
void (*cb_func)(),
void * cb_data
);
Parameters
udev
- Device handle from UsbOpenDevice.
pipe
- Value describing the device, endpoint number, type, and transfer direction.
data
- User data buffer.
len
- Length in bytes of expected transfer.
flags
- Transfer flags. One of the following:
USB_FORCE_SHORT_XFER - force a short transmit last
USB_SHORT_XFER_OK - allow short reads
USB_DELAY_STATUS_STAGE - insert delay before STATUS
USB_MULTI_SHORT_OK - allow multiple short frames
interval
- The interval described in the interrupt endpoint descriptor.
timeout
- Timeout in milliseconds for the transfer.
mbx
- Mailbox handle created by the user. The user must wait on this mailbox and expect a structure of type UsbAsynchNotifyArgs. The user may then call UsbAsynchNotifyArgs.cb_func() and pass any arguments they define. Usually cb_data is the preferred parameter.
cb_func
- Pointer to a user-defined callback function.
cb_data
- User-defined callback data pointer, passed to callback function.
Return Values
USB_ERR_NORMAL_COMPLETION |
Success. The asynchronous operation was started. |
USB_ERR_NO_STACK |
The USB stack was not ready. |
USB_ERR_INVAL |
The pipe or flags parameter was not valid. |
USB_ERR_TIMEOUT |
The device did not respond within the timeout interval specified. |
USB_ERR_NO_DEVICE |
The hdev parameter does not correspond to a valid device. |
USB_ERR_FAULT |
A fault occured during the data transfer. |
USB_ERR_SHORT_XFER |
The device did not transfer the requested number of bytes of data. |
USB_ERR_STALLED |
The device stalled and the endpoint halted while trying to complete the operation. |
Requirements
Versions |
Defined in |
Include |
Link to |
INtime 5.0 |
intime/rt/include/usbif3h |
usbif3h |
usbif3lib |