XilinxProcessorIPLib/drivers/v_sdirxss/src/xv_sdirxss.c
int XV_SdiRxSs_SetCallback(XV_SdiRxSs *InstancePtr, u32 HandlerType,
void *CallbackFunc, void *CallbackRef)
{
	u32 Status;

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

	/* Check for handler type */
	switch (HandlerType) {
		/* Stream down */
	case (XV_SDIRXSS_HANDLER_STREAM_DOWN):
		InstancePtr->StreamDownCallback =
		(XV_SdiRxSs_Callback)CallbackFunc;
		InstancePtr->StreamDownRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;

		/* Stream up */
	case (XV_SDIRXSS_HANDLER_STREAM_UP):
		InstancePtr->StreamUpCallback =
		(XV_SdiRxSs_Callback)CallbackFunc;
		InstancePtr->StreamUpRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;

		/* Over Flow */
	case (XV_SDIRXSS_HANDLER_OVERFLOW):
		InstancePtr->OverFlowCallback =
		(XV_SdiRxSs_Callback)CallbackFunc;
		InstancePtr->OverFlowRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;

		/* Under Flow */
	case (XV_SDIRXSS_HANDLER_UNDERFLOW):
		InstancePtr->UnderFlowCallback =
		(XV_SdiRxSs_Callback)CallbackFunc;
		InstancePtr->UnderFlowRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;

		/* Vsync */
	case (XV_SDIRXSS_HANDLER_VSYNC):
		InstancePtr->VsyncCallback =
		(XV_SdiRxSs_Callback)CallbackFunc;
		InstancePtr->VsyncRef = 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_SDIRXSS_HANDLER_STREAM_DOWN)         StreamDownCallback
* (XV_SDIRXSS_HANDLER_STREAM_UP)           StreamUpCallback
* (XV_SDIRXSS_HANDLER_OVERFLOW)		OverFlowCallback
* (XV_SDIRXSS_HANDLER_UNDERFLOW)           UnderFlowCallback
* (XV_SDIRXSS_HANDLER_VSYNC)		   VsyncCallback
* </pre>
*
* @param    InstancePtr is a pointer to the SDI RX Subsystem 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_SdiRxSs_SetCallback(XV_SdiRxSs *InstancePtr, u32 HandlerType,
void *CallbackFunc, void *CallbackRef)
{
	u32 Status;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(HandlerType >= (XV_SDIRXSS_HANDLER_STREAM_DOWN));
	Xil_AssertNonvoid(CallbackFunc != NULL);
	Xil_AssertNonvoid(CallbackRef != NULL);
	switch (HandlerType) {
	case (XV_SDIRXSS_HANDLER_STREAM_DOWN):
		InstancePtr->StreamDownCallback =
		(XV_SdiRxSs_Callback)CallbackFunc;
		InstancePtr->StreamDownRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;
	case (XV_SDIRXSS_HANDLER_STREAM_UP):
		InstancePtr->StreamUpCallback =
		(XV_SdiRxSs_Callback)CallbackFunc;
		InstancePtr->StreamUpRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;
	case (XV_SDIRXSS_HANDLER_OVERFLOW):
		InstancePtr->OverFlowCallback =
		(XV_SdiRxSs_Callback)CallbackFunc;
		InstancePtr->OverFlowRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;
	case (XV_SDIRXSS_HANDLER_UNDERFLOW):
		InstancePtr->UnderFlowCallback =
		(XV_SdiRxSs_Callback)CallbackFunc;
		InstancePtr->UnderFlowRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;
	case (XV_SDIRXSS_HANDLER_VSYNC):
		InstancePtr->VsyncCallback =
		(XV_SdiRxSs_Callback)CallbackFunc;
		InstancePtr->VsyncRef = CallbackRef;
		Status = (XST_SUCCESS);
		break;
	default:
		Status = (XST_INVALID_PARAM);
		break;
	}
	return Status;
}
int XV_SdiRxSs_SetCallback ( XV_SdiRxSs * InstancePtr , u32 HandlerType , void * CallbackFunc , void * CallbackRef ) { u32 Status ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( HandlerType >= ( XV_SDIRXSS_HANDLER_STREAM_DOWN ) ) ; Xil_AssertNonvoid ( CallbackFunc != NULL ) ; Xil_AssertNonvoid ( CallbackRef != NULL ) ; switch ( HandlerType ) { case ( XV_SDIRXSS_HANDLER_STREAM_DOWN ) : InstancePtr -> StreamDownCallback = ( XV_SdiRxSs_Callback ) CallbackFunc ; InstancePtr -> StreamDownRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_SDIRXSS_HANDLER_STREAM_UP ) : InstancePtr -> StreamUpCallback = ( XV_SdiRxSs_Callback ) CallbackFunc ; InstancePtr -> StreamUpRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_SDIRXSS_HANDLER_OVERFLOW ) : InstancePtr -> OverFlowCallback = ( XV_SdiRxSs_Callback ) CallbackFunc ; InstancePtr -> OverFlowRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_SDIRXSS_HANDLER_UNDERFLOW ) : InstancePtr -> UnderFlowCallback = ( XV_SdiRxSs_Callback ) CallbackFunc ; InstancePtr -> UnderFlowRef = CallbackRef ; Status = ( XST_SUCCESS ) ; break ; case ( XV_SDIRXSS_HANDLER_VSYNC ) : InstancePtr -> VsyncCallback = ( XV_SdiRxSs_Callback ) CallbackFunc ; InstancePtr -> VsyncRef = 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 */ /* Stream up */ /* Over Flow */ /* Under Flow */ /* Vsync */