XilinxProcessorIPLib/drivers/usbpsu/examples/xusb_composite_example.c
static void Usb_AudioOutHandler(void *CallBackRef, u32 RequestedBytes, u32 BytesTxed)
{
	struct Usb_DevData *InstancePtr = CallBackRef;
	USBCH9_DATA *ch9_ptr =
		(USBCH9_DATA *) Get_DrvData(InstancePtr->PrivateData);
	struct composite_dev *interface = (struct composite_dev *)(ch9_ptr->data_ptr);
	struct audio_if *f = &(interface->f_audio);
	u32 Size;

	Size = f->packetsize;
	f->residue += f->packetresidue;

	if ((f->residue / f->interval) >= f->framesize) {
		Size += f->framesize;
		f->residue -= f->framesize * f->interval;
	}

	if (f->firstpkt) {
		f->firstpkt = 0;
	} else {
		if ((f->index + BytesTxed) > f->disksize)
			f->index = 0;

		/* Copy received to RAM array */
		memcpy(f->disk + f->index, BufferPtrTemp, BytesTxed);
		f->index += BytesTxed;
	}

	EpBufferRecv(InstancePtr->PrivateData, ISO_EP,
			BufferPtrTemp, Size);
}
/****************************************************************************/
/**
 * This function is ISO OUT Endpoint handler/Callback function, called by driver
 * when data is received from host.
 *
 * @param	CallBackRef is pointer to Usb_DevData instance.
 * @param	RequestedBytes is number of bytes requested to send.
 * @param	BytesTxed is actual number of bytes sent to Host.
 *
 * @return	None
 *
 * @note	None.
 *
 *****************************************************************************/
This function is ISO OUT Endpoint handler/Callback function, called by driver
when data is received from host.

@param       CallBackRef is pointer to Usb_DevData instance.
@param       RequestedBytes is number of bytes requested to send.
@param       BytesTxed is actual number of bytes sent to Host.

@return      None

@note        None.
This function is ISO OUT Endpoint handler / Callback function called by driver when data is received from host . @param CallBackRef is pointer to Usb_DevData instance . @param RequestedBytes is number of bytes requested to send . @param BytesTxed is actual number of bytes sent to Host . @return None @note None .
static void Usb_AudioOutHandler(void *CallBackRef, u32 RequestedBytes, u32 BytesTxed)
{
	struct Usb_DevData *InstancePtr = CallBackRef;
	USBCH9_DATA *ch9_ptr =
		(USBCH9_DATA *) Get_DrvData(InstancePtr->PrivateData);
	struct composite_dev *interface = (struct composite_dev *)(ch9_ptr->data_ptr);
	struct audio_if *f = &(interface->f_audio);
	u32 Size;
	Size = f->packetsize;
	f->residue += f->packetresidue;
	if ((f->residue / f->interval) >= f->framesize) {
		Size += f->framesize;
		f->residue -= f->framesize * f->interval;
	}
	if (f->firstpkt) {
		f->firstpkt = 0;
	} else {
		if ((f->index + BytesTxed) > f->disksize)
			f->index = 0;
		memcpy(f->disk + f->index, BufferPtrTemp, BytesTxed);
		f->index += BytesTxed;
	}
	EpBufferRecv(InstancePtr->PrivateData, ISO_EP,
			BufferPtrTemp, Size);
}
static void Usb_AudioOutHandler ( void * CallBackRef , u32 RequestedBytes , u32 BytesTxed ) { struct Usb_DevData * InstancePtr = CallBackRef ; USBCH9_DATA * ch9_ptr = ( USBCH9_DATA * ) Get_DrvData ( InstancePtr -> PrivateData ) ; struct composite_dev * interface = ( struct composite_dev * ) ( ch9_ptr -> data_ptr ) ; struct audio_if * f = & ( interface -> f_audio ) ; u32 Size ; Size = f -> packetsize ; f -> residue += f -> packetresidue ; if ( ( f -> residue / f -> interval ) >= f -> framesize ) { Size += f -> framesize ; f -> residue -= f -> framesize * f -> interval ; } if ( f -> firstpkt ) { f -> firstpkt = 0 ; } else { if ( ( f -> index + BytesTxed ) > f -> disksize ) f -> index = 0 ; memcpy ( f -> disk + f -> index , BufferPtrTemp , BytesTxed ) ; f -> index += BytesTxed ; } EpBufferRecv ( InstancePtr -> PrivateData , ISO_EP , BufferPtrTemp , Size ) ; }
This function is ISO OUT Endpoint handler/Callback function, called by driver
 when data is received from host.
This function is ISO OUT Endpoint handler / Callback function called by driver when data is received from host .
/* Copy received to RAM array */