XilinxProcessorIPLib/drivers/csi2tx/src/xcsi2tx_intr.c
int XCsi2Tx_SetCallBack(XCsi2Tx *InstancePtr, u32 HandleType,
		void *Callbackfunc, void *Callbackref)
{
	/* Verify arguments */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(Callbackref != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

	switch (HandleType) {
		case XCSI2TX_HANDLER_WRG_LANE:
			InstancePtr->IncorrectLaneCallBack = Callbackfunc;
			InstancePtr->IncorrectLaneRef = Callbackref;
			break;

		case XCSI2TX_HANDLER_GSPFIFO_FULL:
			InstancePtr->GSPFIFOCallBack = Callbackfunc;
			InstancePtr->GSPFIFORef = Callbackref;
			break;

		case XCSI2TX_HANDLER_ULPS:
			InstancePtr->DPhyUlpsCallBack = Callbackfunc;
			InstancePtr->DPhyUlpsRef = Callbackref;
			break;

		case XCSI2TX_HANDLER_LINEBUF_FULL:
			InstancePtr->LineBufferCallBack = Callbackfunc;
			InstancePtr->LineBufferRef = Callbackref;
			break;

		case XCSI2TX_HANDLER_WRG_DATATYPE:
			InstancePtr->WrgDataTypeCallBack = Callbackfunc;
			InstancePtr->WrgDataTypeRef = Callbackref;
			break;

		case XCSI2TX_HANDLER_UNDERRUN_PIXEL:
			InstancePtr->UnderrunPixelCallBack = Callbackfunc;
			InstancePtr->UnderrunPixelRef = Callbackref;
			break;

		case XCSI2TX_HANDLER_LCERRVC0:
			InstancePtr->LineCountErrVC0 = Callbackfunc;
			InstancePtr->LCErrVC0Ref = Callbackref;
			break;

		case XCSI2TX_HANDLER_LCERRVC1:
			InstancePtr->LineCountErrVC1 = Callbackfunc;
			InstancePtr->LCErrVC1Ref = Callbackref;
			break;

		case XCSI2TX_HANDLER_LCERRVC2:
			InstancePtr->LineCountErrVC2 = Callbackfunc;
			InstancePtr->LCErrVC2Ref = Callbackref;
			break;

		case XCSI2TX_HANDLER_LCERRVC3:
			InstancePtr->LineCountErrVC3 = Callbackfunc;
			InstancePtr->LCErrVC3Ref = Callbackref;
			break;

		default:
			/* Invalid value of HandleType */
			return XST_INVALID_PARAM;
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This routine installs an asynchronous callback function for the given
* HandlerType:
*
* <pre>
* HandlerType				Callback Function Type
* ----------------------------  --------------------------------------------
* (XCSI2TX_HANDLER_WRG_LANE)		IncorrectLaneCallBack
* (XCSI2TX_HANDLER_GSPFIFO_FULL)	GSPFIFOCallBack
* (XCSI2TX_HANDLER_ULPS)		DPhyUlpsCallBack
* (XCSI2TX_HANDLER_LINEBUF_FULL)	LineBufferCallBack
* (XCSI2TX_HANDLER_WRG_DATATYPE)	WrgDataTypeCallBack
* (XCSI2TX_HANDLER_UNDERRUN_PIXEL)	UnderrunPixelCallBack
* (XCSI2TX_HANDLER_LCERRVC0)		LineCountErrVC0
* (XCSI2TX_HANDLER_LCERRVC1)		LineCountErrVC1
* (XCSI2TX_HANDLER_LCERRVC2)		LineCountErrVC2
* (XCSI2TX_HANDLER_LCERRVC3)		LineCountErrVC3
* </pre>
*
* @param	InstancePtr is the XCsi2Tx instance to operate on
* @param 	HandleType is the type of call back to be registered.
* @param	Callbackfunc is the pointer to a call back funtion which
* 		is called when a particular event occurs.
* @param 	Callbackref is a void pointer to data to be referenced to
* 		by the Callbackfunc
*
* @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


This routine installs an asynchronous callback function for the given HandlerType . HandlerType Callback Function Type
int XCsi2Tx_SetCallBack(XCsi2Tx *InstancePtr, u32 HandleType,
		void *Callbackfunc, void *Callbackref)
{
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(Callbackref != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	switch (HandleType) {
		case XCSI2TX_HANDLER_WRG_LANE:
			InstancePtr->IncorrectLaneCallBack = Callbackfunc;
			InstancePtr->IncorrectLaneRef = Callbackref;
			break;
		case XCSI2TX_HANDLER_GSPFIFO_FULL:
			InstancePtr->GSPFIFOCallBack = Callbackfunc;
			InstancePtr->GSPFIFORef = Callbackref;
			break;
		case XCSI2TX_HANDLER_ULPS:
			InstancePtr->DPhyUlpsCallBack = Callbackfunc;
			InstancePtr->DPhyUlpsRef = Callbackref;
			break;
		case XCSI2TX_HANDLER_LINEBUF_FULL:
			InstancePtr->LineBufferCallBack = Callbackfunc;
			InstancePtr->LineBufferRef = Callbackref;
			break;
		case XCSI2TX_HANDLER_WRG_DATATYPE:
			InstancePtr->WrgDataTypeCallBack = Callbackfunc;
			InstancePtr->WrgDataTypeRef = Callbackref;
			break;
		case XCSI2TX_HANDLER_UNDERRUN_PIXEL:
			InstancePtr->UnderrunPixelCallBack = Callbackfunc;
			InstancePtr->UnderrunPixelRef = Callbackref;
			break;
		case XCSI2TX_HANDLER_LCERRVC0:
			InstancePtr->LineCountErrVC0 = Callbackfunc;
			InstancePtr->LCErrVC0Ref = Callbackref;
			break;
		case XCSI2TX_HANDLER_LCERRVC1:
			InstancePtr->LineCountErrVC1 = Callbackfunc;
			InstancePtr->LCErrVC1Ref = Callbackref;
			break;
		case XCSI2TX_HANDLER_LCERRVC2:
			InstancePtr->LineCountErrVC2 = Callbackfunc;
			InstancePtr->LCErrVC2Ref = Callbackref;
			break;
		case XCSI2TX_HANDLER_LCERRVC3:
			InstancePtr->LineCountErrVC3 = Callbackfunc;
			InstancePtr->LCErrVC3Ref = Callbackref;
			break;
		default:
			return XST_INVALID_PARAM;
	}
	return XST_SUCCESS;
}
int XCsi2Tx_SetCallBack ( XCsi2Tx * InstancePtr , u32 HandleType , void * Callbackfunc , void * Callbackref ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( Callbackref != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; switch ( HandleType ) { case XCSI2TX_HANDLER_WRG_LANE : InstancePtr -> IncorrectLaneCallBack = Callbackfunc ; InstancePtr -> IncorrectLaneRef = Callbackref ; break ; case XCSI2TX_HANDLER_GSPFIFO_FULL : InstancePtr -> GSPFIFOCallBack = Callbackfunc ; InstancePtr -> GSPFIFORef = Callbackref ; break ; case XCSI2TX_HANDLER_ULPS : InstancePtr -> DPhyUlpsCallBack = Callbackfunc ; InstancePtr -> DPhyUlpsRef = Callbackref ; break ; case XCSI2TX_HANDLER_LINEBUF_FULL : InstancePtr -> LineBufferCallBack = Callbackfunc ; InstancePtr -> LineBufferRef = Callbackref ; break ; case XCSI2TX_HANDLER_WRG_DATATYPE : InstancePtr -> WrgDataTypeCallBack = Callbackfunc ; InstancePtr -> WrgDataTypeRef = Callbackref ; break ; case XCSI2TX_HANDLER_UNDERRUN_PIXEL : InstancePtr -> UnderrunPixelCallBack = Callbackfunc ; InstancePtr -> UnderrunPixelRef = Callbackref ; break ; case XCSI2TX_HANDLER_LCERRVC0 : InstancePtr -> LineCountErrVC0 = Callbackfunc ; InstancePtr -> LCErrVC0Ref = Callbackref ; break ; case XCSI2TX_HANDLER_LCERRVC1 : InstancePtr -> LineCountErrVC1 = Callbackfunc ; InstancePtr -> LCErrVC1Ref = Callbackref ; break ; case XCSI2TX_HANDLER_LCERRVC2 : InstancePtr -> LineCountErrVC2 = Callbackfunc ; InstancePtr -> LCErrVC2Ref = Callbackref ; break ; case XCSI2TX_HANDLER_LCERRVC3 : InstancePtr -> LineCountErrVC3 = Callbackfunc ; InstancePtr -> LCErrVC3Ref = Callbackref ; break ; default : return XST_INVALID_PARAM ; } return XST_SUCCESS ; }
This routine installs an asynchronous callback function for the given
HandlerType:
This routine installs an asynchronous callback function for the given HandlerType :
/* Verify arguments */ /* Invalid value of HandleType */