uint8_t USBHostRead( uint8_t deviceAddress, uint8_t endpoint, uint8_t * data, uint32_t size );
This function initiates a read from the attached device.
If the endpoint is isochronous, special conditions apply. The pData and size parameters have slightly different meanings, since multiple buffers are required. Once started, an isochronous transfer will continue with no upper layer intervention until USBHostTerminateTransfer() is called. The ISOCHRONOUS_DATA_BUFFERS structure should not be manipulated until the transfer is terminated.
To clarify parameter usage and to simplify casting, use the macro USBHostReadIsochronous() when reading from an isochronous endpoint.
None
Return Values |
Description |
USB_SUCCESS |
Read started successfully. |
USB_UNKNOWN_DEVICE |
Device with the specified address not found. |
USB_INVALID_STATE |
We are not in a normal running state. |
USB_ENDPOINT_ILLEGAL_TYPE |
Must use USBHostControlRead to read from a control endpoint. |
USB_ENDPOINT_ILLEGAL_DIRECTION |
Must read from an IN endpoint. |
USB_ENDPOINT_STALLED |
Endpoint is stalled. Must be cleared by the application. |
USB_ENDPOINT_ERROR |
Endpoint has too many errors. Must be cleared by the application. |
USB_ENDPOINT_BUSY |
A Read is already in progress. |
USB_ENDPOINT_NOT_FOUND |
Invalid endpoint. |
None
MLA - USB Library Help Version : 2.16
![]() |