XilinxProcessorIPLib/drivers/v_sditx/src/xv_sditx_intr.c
int XV_SdiTx_SetCallback(XV_SdiTx *InstancePtr, u32 HandlerType,
void *CallbackFunc, void *CallbackRef)
{
	u32 Status;

	/* Verify arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(HandlerType >= (XV_SDITX_HANDLER_GTRESET_DONE));
	Xil_AssertNonvoid(CallbackFunc != NULL);
	Xil_AssertNonvoid(CallbackRef != NULL);

	/* Check for handler type */
	switch (HandlerType) {
	/* Stream down */
	case (XV_SDITX_HANDLER_GTRESET_DONE):
		InstancePtr->GtRstDoneCallback = (XV_SdiTx_Callback)CallbackFunc;
		InstancePtr->GtRstDoneRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;

	/* Overflow */
	case (XV_SDITX_HANDLER_OVERFLOW):
		InstancePtr->OverFlowCallback = (XV_SdiTx_Callback)CallbackFunc;
		InstancePtr->OverFlowRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;

	/* UnderFlow */
	case (XV_SDITX_HANDLER_UNDERFLOW):
		InstancePtr->UnderFlowCallback = (XV_SdiTx_Callback)CallbackFunc;
		InstancePtr->UnderFlowRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;

	/* CE align errors */
	case (XV_SDITX_HANDLER_CEALIGN):
		InstancePtr->CeAlignErrCallback = (XV_SdiTx_Callback)CallbackFunc;
		InstancePtr->CeAlignErrRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;

	/* Axi4s video lock  */
	case (XV_SDITX_HANDLER_AXI4SVIDLOCK):
		InstancePtr->Axi4sVidLockCallback = (XV_SdiTx_Callback)CallbackFunc;
		InstancePtr->Axi4sVidLockRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;
	default:
		Status = (XST_INVALID_PARAM);
		break;
	}

	return Status;
}
/*****************************************************************************/
/**
*
* This function installs an asynchronous callback function for the given
* HandlerType:
*
* <pre>
* HandlerType                       Callback Function Type
* -------------------------         -------------------------------------------
* (XV_SDITX_HANDLER_GTRESET_DONE)	GtRstDoneCallback
* (XV_SDITX_HANDLER_OVERFLOW)		OverFlowCallback
* (XV_SDITX_HANDLER_UNDERFLOW)		UnderFlowCallback
* </pre>
*
* @param    InstancePtr is a pointer to the SDI TX core instance.
* @param    HandlerType specifies the type of handler.
* @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 if callback function installed successfully.
*       - 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 function installs an asynchronous callback function for the given
HandlerType.


HandlerType                       Callback Function Type


This function installs an asynchronous callback function for the given HandlerType . HandlerType Callback Function Type
int XV_SdiTx_SetCallback(XV_SdiTx *InstancePtr, u32 HandlerType,
void *CallbackFunc, void *CallbackRef)
{
	u32 Status;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(HandlerType >= (XV_SDITX_HANDLER_GTRESET_DONE));
	Xil_AssertNonvoid(CallbackFunc != NULL);
	Xil_AssertNonvoid(CallbackRef != NULL);
	switch (HandlerType) {
	case (XV_SDITX_HANDLER_GTRESET_DONE):
		InstancePtr->GtRstDoneCallback = (XV_SdiTx_Callback)CallbackFunc;
		InstancePtr->GtRstDoneRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;
	case (XV_SDITX_HANDLER_OVERFLOW):
		InstancePtr->OverFlowCallback = (XV_SdiTx_Callback)CallbackFunc;
		InstancePtr->OverFlowRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;
	case (XV_SDITX_HANDLER_UNDERFLOW):
		InstancePtr->UnderFlowCallback = (XV_SdiTx_Callback)CallbackFunc;
		InstancePtr->UnderFlowRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;
	case (XV_SDITX_HANDLER_CEALIGN):
		InstancePtr->CeAlignErrCallback = (XV_SdiTx_Callback)CallbackFunc;
		InstancePtr->CeAlignErrRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;
	case (XV_SDITX_HANDLER_AXI4SVIDLOCK):
		InstancePtr->Axi4sVidLockCallback = (XV_SdiTx_Callback)CallbackFunc;
		InstancePtr->Axi4sVidLockRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;
	default:
		Status = (XST_INVALID_PARAM);
		break;
	}
	return Status;
}
int XV_SdiTx_SetCallback ( XV_SdiTx * InstancePtr , u32 HandlerType , void * CallbackFunc , void * CallbackRef ) { u32 Status ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( HandlerType >= ( XV_SDITX_HANDLER_GTRESET_DONE ) ) ; Xil_AssertNonvoid ( CallbackFunc != NULL ) ; Xil_AssertNonvoid ( CallbackRef != NULL ) ; switch ( HandlerType ) { case ( XV_SDITX_HANDLER_GTRESET_DONE ) : InstancePtr -> GtRstDoneCallback = ( XV_SdiTx_Callback ) CallbackFunc ; InstancePtr -> GtRstDoneRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_SDITX_HANDLER_OVERFLOW ) : InstancePtr -> OverFlowCallback = ( XV_SdiTx_Callback ) CallbackFunc ; InstancePtr -> OverFlowRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_SDITX_HANDLER_UNDERFLOW ) : InstancePtr -> UnderFlowCallback = ( XV_SdiTx_Callback ) CallbackFunc ; InstancePtr -> UnderFlowRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_SDITX_HANDLER_CEALIGN ) : InstancePtr -> CeAlignErrCallback = ( XV_SdiTx_Callback ) CallbackFunc ; InstancePtr -> CeAlignErrRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_SDITX_HANDLER_AXI4SVIDLOCK ) : InstancePtr -> Axi4sVidLockCallback = ( XV_SdiTx_Callback ) CallbackFunc ; InstancePtr -> Axi4sVidLockRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; default : Status = ( XST_INVALID_PARAM ) ; break ; } return Status ; }
This function installs an asynchronous callback function for the given
HandlerType:
This function installs an asynchronous callback function for the given HandlerType :
/* Verify arguments. */ /* Check for handler type */ /* Stream down */ /* Overflow */ /* UnderFlow */ /* CE align errors */ /* Axi4s video lock  */