XilinxProcessorIPLib/drivers/usbps/src/xusbps_endpoint.c
s32 XUsbPs_EpSetIsoHandler(XUsbPs *InstancePtr, u8 EpNum, u8 Direction,
					XUsbPs_EpIsoHandlerFunc CallBackFunc)
{
	XUsbPs_Endpoint	*Ep;
	void *CallBackRef = (void *) InstancePtr->AppData;

	Xil_AssertNonvoid(InstancePtr  != NULL);
	Xil_AssertNonvoid(CallBackFunc != NULL);
	Xil_AssertNonvoid(EpNum < InstancePtr->DeviceConfig.NumEndpoints);

	Ep = &InstancePtr->DeviceConfig.Ep[EpNum];

	if (Direction & XUSBPS_EP_DIRECTION_OUT) {
		Ep->Out.HandlerIsoFunc	= CallBackFunc;
		Ep->Out.HandlerRef	= CallBackRef;
	}

	if (Direction & XUSBPS_EP_DIRECTION_IN) {
		Ep->In.HandlerIsoFunc	= CallBackFunc;
		Ep->In.HandlerRef	= CallBackRef;
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
 * This function sets the handler for ISO endpoint events.
 *
 * @param	InstancePtr is a pointer to the XUsbPs instance of the
 *		controller.
 * @param	EpNum is the number of the endpoint to receive data from.
 * @param	Direction is the direction of the endpoint (bitfield):
 * 			- XUSBPS_EP_DIRECTION_OUT
 * 			- XUSBPS_EP_DIRECTION_IN
 * @param	CallBackFunc is the Handler callback function.
 *		Can be NULL if the user wants to disable the handler entry.
 *
 * @return
 *		- XST_SUCCESS: The operation completed successfully.
 *		- XST_FAILURE: An error occurred.
 *		- XST_INVALID_PARAM: Invalid parameter passed.
 *
 * @note
 * 		The user can disable a handler by setting the callback function
 * 		pointer to NULL.
 *
 ******************************************************************************/
This function sets the handler for ISO endpoint events.
@param       InstancePtr is a pointer to the XUsbPs instance of the
controller.
@param       EpNum is the number of the endpoint to receive data from.
@param       Direction is the direction of the endpoint (bitfield):
- XUSBPS_EP_DIRECTION_OUT
- XUSBPS_EP_DIRECTION_IN
@param       CallBackFunc is the Handler callback function.
Can be NULL if the user wants to disable the handler entry.

@return
- XST_SUCCESS: The operation completed successfully.
- XST_FAILURE: An error occurred.
- XST_INVALID_PARAM: Invalid parameter passed.

@note
The user can disable a handler by setting the callback function
pointer to NULL.
This function sets the handler for ISO endpoint events . @param InstancePtr is a pointer to the XUsbPs instance of the controller . @param EpNum is the number of the endpoint to receive data from . @param Direction is the direction of the endpoint ( bitfield ) : - XUSBPS_EP_DIRECTION_OUT - XUSBPS_EP_DIRECTION_IN @param CallBackFunc is the Handler callback function . Can be NULL if the user wants to disable the handler entry . @return - XST_SUCCESS : The operation completed successfully . - XST_FAILURE : An error occurred . - XST_INVALID_PARAM : Invalid parameter passed . @note The user can disable a handler by setting the callback function pointer to NULL .
s32 XUsbPs_EpSetIsoHandler(XUsbPs *InstancePtr, u8 EpNum, u8 Direction,
					XUsbPs_EpIsoHandlerFunc CallBackFunc)
{
	XUsbPs_Endpoint	*Ep;
	void *CallBackRef = (void *) InstancePtr->AppData;
	Xil_AssertNonvoid(InstancePtr  != NULL);
	Xil_AssertNonvoid(CallBackFunc != NULL);
	Xil_AssertNonvoid(EpNum < InstancePtr->DeviceConfig.NumEndpoints);
	Ep = &InstancePtr->DeviceConfig.Ep[EpNum];
	if (Direction & XUSBPS_EP_DIRECTION_OUT) {
		Ep->Out.HandlerIsoFunc	= CallBackFunc;
		Ep->Out.HandlerRef	= CallBackRef;
	}
	if (Direction & XUSBPS_EP_DIRECTION_IN) {
		Ep->In.HandlerIsoFunc	= CallBackFunc;
		Ep->In.HandlerRef	= CallBackRef;
	}
	return XST_SUCCESS;
}
s32 XUsbPs_EpSetIsoHandler ( XUsbPs * InstancePtr , u8 EpNum , u8 Direction , XUsbPs_EpIsoHandlerFunc CallBackFunc ) { XUsbPs_Endpoint * Ep ; void * CallBackRef = ( void * ) InstancePtr -> AppData ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( CallBackFunc != NULL ) ; Xil_AssertNonvoid ( EpNum < InstancePtr -> DeviceConfig . NumEndpoints ) ; Ep = & InstancePtr -> DeviceConfig . Ep [ EpNum ] ; if ( Direction & XUSBPS_EP_DIRECTION_OUT ) { Ep -> Out . HandlerIsoFunc = CallBackFunc ; Ep -> Out . HandlerRef = CallBackRef ; } if ( Direction & XUSBPS_EP_DIRECTION_IN ) { Ep -> In . HandlerIsoFunc = CallBackFunc ; Ep -> In . HandlerRef = CallBackRef ; } return XST_SUCCESS ; }
This function sets the handler for ISO endpoint events.
This function sets the handler for ISO endpoint events .