XilinxProcessorIPLib/drivers/mcdma/src/xmcdma_intr.c
s32 XMcdma_ChanSetCallBack(XMcdma_ChanCtrl *Chan, XMcdma_ChanHandler HandlerType,
			   void *CallBackFunc, void *CallBackRef)
{
	s32 Status;

	/* Verify arguments. */
        Xil_AssertNonvoid(CallBackFunc != NULL);
        Xil_AssertNonvoid(CallBackRef != NULL);
        Xil_AssertNonvoid((HandlerType == XMCDMA_CHAN_HANDLER_DONE) ||
			  (HandlerType == XMCDMA_CHAN_HANDLER_ERROR));

	/*
         * Calls the respective callback function corresponding to
         * the handler type
         */
        switch (HandlerType) {
	case XMCDMA_CHAN_HANDLER_DONE:
		Chan->DoneHandler =
			(XMcdma_ChanDoneHandler)((void *)CallBackFunc);
                Chan->DoneRef = CallBackRef;
		Status = (XST_SUCCESS);
		break;

	case XMCDMA_CHAN_HANDLER_ERROR:
		Chan->ErrorHandler =
			(XMcdma_ChanErrorHandler)((void *)CallBackFunc);
		Chan->ErrorRef = CallBackRef;
		Status = (XST_SUCCESS);
		break;

	default:
		Status = (XST_INVALID_PARAM);
		break;
	}

	return Status;
}
/*****************************************************************************/
/**
*
* This routine installs an asynchronous callback function for the given
* HandlerType.
*
* <pre>
* HandlerType              Callback Function Type
* -----------------------  --------------------------------------------------
* XMCDMA_HANDLER_DONE      Channel Done handler
* XMCDMA_HANDLER_ERROR     Channel Error handler
*
* </pre>
*
* @param	Chan is the Channel instance to be worked on
* @param	HandlerType specifies which callback is to be attached.
* @param	CallBackFunc is the address of the callback function.
* @param	CallBackRef is a user data item that will be passed to the
* 		callback function when it is invoked.
*
* @return
*		- XST_SUCCESS when handler is installed.
*		- XST_INVALID_PARAM when HandlerType is invalid.
*
* @note		Invoking this function for a handler that already has been
*		installed replaces it with the new handler.
*
******************************************************************************/
This routine installs an asynchronous callback function for the given
HandlerType.


HandlerType              Callback Function Type

XMCDMA_HANDLER_DONE      Channel Done handler
XMCDMA_HANDLER_ERROR     Channel Error handler


This routine installs an asynchronous callback function for the given HandlerType . HandlerType Callback Function Type XMCDMA_HANDLER_DONE Channel Done handler XMCDMA_HANDLER_ERROR Channel Error handler
s32 XMcdma_ChanSetCallBack(XMcdma_ChanCtrl *Chan, XMcdma_ChanHandler HandlerType,
			   void *CallBackFunc, void *CallBackRef)
{
	s32 Status;
        Xil_AssertNonvoid(CallBackFunc != NULL);
        Xil_AssertNonvoid(CallBackRef != NULL);
        Xil_AssertNonvoid((HandlerType == XMCDMA_CHAN_HANDLER_DONE) ||
			  (HandlerType == XMCDMA_CHAN_HANDLER_ERROR));
        switch (HandlerType) {
	case XMCDMA_CHAN_HANDLER_DONE:
		Chan->DoneHandler =
			(XMcdma_ChanDoneHandler)((void *)CallBackFunc);
                Chan->DoneRef = CallBackRef;
		Status = (XST_SUCCESS);
		break;
	case XMCDMA_CHAN_HANDLER_ERROR:
		Chan->ErrorHandler =
			(XMcdma_ChanErrorHandler)((void *)CallBackFunc);
		Chan->ErrorRef = CallBackRef;
		Status = (XST_SUCCESS);
		break;
	default:
		Status = (XST_INVALID_PARAM);
		break;
	}
	return Status;
}
s32 XMcdma_ChanSetCallBack ( XMcdma_ChanCtrl * Chan , XMcdma_ChanHandler HandlerType , void * CallBackFunc , void * CallBackRef ) { s32 Status ; Xil_AssertNonvoid ( CallBackFunc != NULL ) ; Xil_AssertNonvoid ( CallBackRef != NULL ) ; Xil_AssertNonvoid ( ( HandlerType == XMCDMA_CHAN_HANDLER_DONE ) || ( HandlerType == XMCDMA_CHAN_HANDLER_ERROR ) ) ; switch ( HandlerType ) { case XMCDMA_CHAN_HANDLER_DONE : Chan -> DoneHandler = ( XMcdma_ChanDoneHandler ) ( ( void * ) CallBackFunc ) ; Chan -> DoneRef = CallBackRef ; Status = ( XST_SUCCESS ) ; break ; case XMCDMA_CHAN_HANDLER_ERROR : Chan -> ErrorHandler = ( XMcdma_ChanErrorHandler ) ( ( void * ) CallBackFunc ) ; Chan -> ErrorRef = CallBackRef ; Status = ( XST_SUCCESS ) ; break ; default : Status = ( XST_INVALID_PARAM ) ; break ; } return Status ; }
This routine installs an asynchronous callback function for the given
HandlerType.
This routine installs an asynchronous callback function for the given HandlerType .
/* Verify arguments. */ /*
         * Calls the respective callback function corresponding to
         * the handler type
         */