XilinxProcessorIPLib/drivers/v_sditx/src/xv_sditx.c
int XV_SdiTx_CfgInitialize(XV_SdiTx *InstancePtr, XV_SdiTx_Config *CfgPtr,
				UINTPTR EffectiveAddr)
{
	/* Verify arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(CfgPtr != NULL);
	Xil_AssertNonvoid(EffectiveAddr != (UINTPTR)0x0);

	/* Setup the instance */
	(void)memset((void *)InstancePtr, 0, sizeof(XV_SdiTx));
	(void)memcpy((void *)&(InstancePtr->Config), (const void *)CfgPtr,
	sizeof(XV_SdiTx_Config));
	InstancePtr->Config.BaseAddress = EffectiveAddr;

	/*
	 * Callbacks
	 * These are placeholders pointing to the StubCallback
	 * The actual callback pointers will be assigned by the SetCallback
	 * function
	 */
	InstancePtr->GtRstDoneCallback = (XV_SdiTx_Callback)((void *)StubCallback);
	InstancePtr->OverFlowCallback = (XV_SdiTx_Callback)((void *)StubCallback);
	InstancePtr->UnderFlowCallback = (XV_SdiTx_Callback)((void *)StubCallback);
	InstancePtr->CeAlignErrCallback = (XV_SdiTx_Callback)((void *)StubCallback);
	InstancePtr->Axi4sVidLockCallback = (XV_SdiTx_Callback)((void *)StubCallback);

	/* Stop SDI TX Core */
	XV_SdiTx_StopSdi(InstancePtr);

	/* Set default settings */
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_INSERTCRC, 1);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_INSERTST352, 1);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_ST352OVERWRITE, 1);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_INSERTSYNCBIT, 1);
	/* With bridge, don't include line number */
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_SDBITREPBYPASS, 0);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_USEANCIN, 0);
	/*
	 * With bridge, don't include line number because the bridge has already
	 * inserted line numbers
	 */
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_INSERTLN, 0);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_INSERTEDH, 1);

	InstancePtr->State = XV_SDITX_STATE_GTRESETDONE_NORMAL;

	/* Clear SDI registers and variables */
	XV_SdiTx_Reset(InstancePtr);

	/* Set global interrupt enable bit */
	XV_SdiTx_SetGlobalInterrupt(InstancePtr);

	/* Reset the hardware and set the flag to indicate the driver is ready */
	InstancePtr->IsReady = (u32)(XIL_COMPONENT_IS_READY);

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function initializes the SDI TX core. This function must be called
* prior to using the SDI TX core. Initialization of the SDI TX includes
* setting up the instance data and ensuring the hardware is in a quiescent
* state.
*
* @param    InstancePtr is a pointer to the XV_SdiTx core instance.
* @param    CfgPtr points to the configuration structure associated with
*       the SDI TX core.
* @param    EffectiveAddr is the base address of the device. If address
*       translation is being used, then this parameter must reflect the
*       virtual base address. Otherwise, the physical address should be
*       used.
*
* @return
*       - XST_SUCCESS if XV_SdiTx_CfgInitialize was successful.
*       - XST_FAILURE if SDI TX initialization failed
*
* @note     None.
*
******************************************************************************/
This function initializes the SDI TX core. This function must be called
prior to using the SDI TX core. Initialization of the SDI TX includes
setting up the instance data and ensuring the hardware is in a quiescent
state.
This function initializes the SDI TX core . This function must be called prior to using the SDI TX core . Initialization of the SDI TX includes setting up the instance data and ensuring the hardware is in a quiescent state .
int XV_SdiTx_CfgInitialize(XV_SdiTx *InstancePtr, XV_SdiTx_Config *CfgPtr,
				UINTPTR EffectiveAddr)
{
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(CfgPtr != NULL);
	Xil_AssertNonvoid(EffectiveAddr != (UINTPTR)0x0);
	(void)memset((void *)InstancePtr, 0, sizeof(XV_SdiTx));
	(void)memcpy((void *)&(InstancePtr->Config), (const void *)CfgPtr,
	sizeof(XV_SdiTx_Config));
	InstancePtr->Config.BaseAddress = EffectiveAddr;
	InstancePtr->GtRstDoneCallback = (XV_SdiTx_Callback)((void *)StubCallback);
	InstancePtr->OverFlowCallback = (XV_SdiTx_Callback)((void *)StubCallback);
	InstancePtr->UnderFlowCallback = (XV_SdiTx_Callback)((void *)StubCallback);
	InstancePtr->CeAlignErrCallback = (XV_SdiTx_Callback)((void *)StubCallback);
	InstancePtr->Axi4sVidLockCallback = (XV_SdiTx_Callback)((void *)StubCallback);
	XV_SdiTx_StopSdi(InstancePtr);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_INSERTCRC, 1);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_INSERTST352, 1);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_ST352OVERWRITE, 1);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_INSERTSYNCBIT, 1);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_SDBITREPBYPASS, 0);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_USEANCIN, 0);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_INSERTLN, 0);
	XV_SdiTx_SetCoreSettings(InstancePtr, XV_SDITX_CORESELID_INSERTEDH, 1);
	InstancePtr->State = XV_SDITX_STATE_GTRESETDONE_NORMAL;
	XV_SdiTx_Reset(InstancePtr);
	XV_SdiTx_SetGlobalInterrupt(InstancePtr);
	InstancePtr->IsReady = (u32)(XIL_COMPONENT_IS_READY);
	return XST_SUCCESS;
}
int XV_SdiTx_CfgInitialize ( XV_SdiTx * InstancePtr , XV_SdiTx_Config * CfgPtr , UINTPTR EffectiveAddr ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( CfgPtr != NULL ) ; Xil_AssertNonvoid ( EffectiveAddr != ( UINTPTR ) 0x0 ) ; ( void ) memset ( ( void * ) InstancePtr , 0 , sizeof ( XV_SdiTx ) ) ; ( void ) memcpy ( ( void * ) & ( InstancePtr -> Config ) , ( const void * ) CfgPtr , sizeof ( XV_SdiTx_Config ) ) ; InstancePtr -> Config . BaseAddress = EffectiveAddr ; InstancePtr -> GtRstDoneCallback = ( XV_SdiTx_Callback ) ( ( void * ) StubCallback ) ; InstancePtr -> OverFlowCallback = ( XV_SdiTx_Callback ) ( ( void * ) StubCallback ) ; InstancePtr -> UnderFlowCallback = ( XV_SdiTx_Callback ) ( ( void * ) StubCallback ) ; InstancePtr -> CeAlignErrCallback = ( XV_SdiTx_Callback ) ( ( void * ) StubCallback ) ; InstancePtr -> Axi4sVidLockCallback = ( XV_SdiTx_Callback ) ( ( void * ) StubCallback ) ; XV_SdiTx_StopSdi ( InstancePtr ) ; XV_SdiTx_SetCoreSettings ( InstancePtr , XV_SDITX_CORESELID_INSERTCRC , 1 ) ; XV_SdiTx_SetCoreSettings ( InstancePtr , XV_SDITX_CORESELID_INSERTST352 , 1 ) ; XV_SdiTx_SetCoreSettings ( InstancePtr , XV_SDITX_CORESELID_ST352OVERWRITE , 1 ) ; XV_SdiTx_SetCoreSettings ( InstancePtr , XV_SDITX_CORESELID_INSERTSYNCBIT , 1 ) ; XV_SdiTx_SetCoreSettings ( InstancePtr , XV_SDITX_CORESELID_SDBITREPBYPASS , 0 ) ; XV_SdiTx_SetCoreSettings ( InstancePtr , XV_SDITX_CORESELID_USEANCIN , 0 ) ; XV_SdiTx_SetCoreSettings ( InstancePtr , XV_SDITX_CORESELID_INSERTLN , 0 ) ; XV_SdiTx_SetCoreSettings ( InstancePtr , XV_SDITX_CORESELID_INSERTEDH , 1 ) ; InstancePtr -> State = XV_SDITX_STATE_GTRESETDONE_NORMAL ; XV_SdiTx_Reset ( InstancePtr ) ; XV_SdiTx_SetGlobalInterrupt ( InstancePtr ) ; InstancePtr -> IsReady = ( u32 ) ( XIL_COMPONENT_IS_READY ) ; return XST_SUCCESS ; }
This function initializes the SDI TX core.
This function initializes the SDI TX core .
/* Verify arguments. */ /* Setup the instance */ /*
	 * Callbacks
	 * These are placeholders pointing to the StubCallback
	 * The actual callback pointers will be assigned by the SetCallback
	 * function
	 */ /* Stop SDI TX Core */ /* Set default settings */ /* With bridge, don't include line number */ /*
	 * With bridge, don't include line number because the bridge has already
	 * inserted line numbers
	 */ /* Clear SDI registers and variables */ /* Set global interrupt enable bit */ /* Reset the hardware and set the flag to indicate the driver is ready */