HIDTxHandleBusy Macro

Microchip USB Device Library

USB Device Library Help
HIDTxHandleBusy Macro
C
#define HIDTxHandleBusy(handle) USBHandleBusy(handle)
Description

Retreives the status of the buffer ownership. This function will indicate if the previous transfer is complete or not. 

This function will take the input handle (pointer to a BDT entry) and will check the UOWN bit. If the UOWN bit is set then that indicates that the transfer is not complete and the USB module still owns the data memory. If the UOWN bit is clear that means that the transfer is complete and that the CPU now owns the data memory. 

For more information about the BDT, please refer to the appropriate datasheet for the device in use. 

Typical Usage:

//make sure that the last transfer isn't busy by checking the handle
if(!HIDTxHandleBusy(USBInHandle))
{
    //Send the data contained in the ToSendDataBuffer[] array out on
    //  endpoint HID_EP
    USBInHandle = HIDTxPacket(HID_EP,(BYTE*)&ToSendDataBuffer[0],sizeof(ToSendDataBuffer));
}
Preconditions

None.

Parameters
Parameters 
Description 
USB_HANDLE handle 
the handle for the transfer in question. The handle is returned by the HIDTxPacket() and HIDRxPacket() functions. Please insure that USB_HANDLE objects are initialized to NULL. 
Return Values
Return Values 
Description 
TRUE 
the HID handle is still busy 
FALSE 
the HID handle is not busy and is ready to send additional data. 
Remarks

None

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