USBGenRead Macro

Microchip USB Device Library

USB Device Library Help
USBGenRead Macro
C
#define USBGenRead(ep,data,len) USBRxOnePacket(ep,data,len)
Description

Receives the specified data out the specified endpoint. 

Typical Usage:

//Read 64-bytes from endpoint USBGEN_EP_NUM, into the OUTPacket array.
//  Make sure to save the return handle so that we can check it later
//  to determine when the transfer is complete.
if(!USBHandleBusy(USBOutHandle))
{
    USBOutHandle = USBGenRead(USBGEN_EP_NUM,(BYTE*)&OUTPacket,64);
}
Preconditions

None

Parameters
Parameters 
Description 
ep 
the endpoint you want to receive the data into 
data 
pointer to where the data will go when it arrives 
len 
the length of the data that you wish to receive 
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.