USB Library
USBHostWrite Function
Syntax
uint8_t USBHostWrite(
    uint8_t deviceAddress, 
    uint8_t endpoint, 
    uint8_t * data, 
    uint32_t size
);
Description

This function initiates a write to the attached device. The data buffer pointed to by *data must remain valid during the entire time that the write is taking place; the data is not buffered by the stack. 

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 USBHostWriteIsochronous() when writing to an isochronous endpoint.

Preconditions

None

Return Values
Return Values 
Description 
USB_SUCCESS 
Write 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 USBHostControlWrite to write to a control endpoint. 
USB_ENDPOINT_ILLEGAL_DIRECTION 
Must write to an OUT 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 Write is already in progress. 
USB_ENDPOINT_NOT_FOUND 
Invalid endpoint. 
Remarks

None

MLA - USB Library Help Version : 2.16
http://www.microchip.com/mla