USBGenWrite Macro

Microchip USB Device Library

USB Device Library Help
USBGenWrite Macro
C
#define USBGenWrite(ep,data,len) USBTxOnePacket(ep,data,len)
Description

This function sends the specified data out the specified endpoint and returns a handle to the transfer information. 

Typical Usage:

//make sure that the last transfer isn't busy by checking the handle
if(!USBHandleBusy(USBGenericInHandle))
{
    //Send the data contained in the INPacket[] array out on
    //  endpoint USBGEN_EP_NUM
    USBGenericInHandle = USBGenWrite(USBGEN_EP_NUM,(BYTE*)&INPacket[0],sizeof(INPacket));
}
Preconditions

None

Parameters
Parameters 
Description 
ep 
the endpoint you want to send the data out of 
data 
pointer to the data that you wish to send 
len 
the length of the data that you wish to send 
Return Values
Return Values 
Description 
a handle for the transfer. This information should be kept to track the status of the transfer 
Remarks

None

Microchip MCHPFSUSB v2.3 - Sept 20, 2008
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.