XilinxProcessorIPLib/drivers/v_hdmitxss1/examples/xhdmi_example/video_fmc.c
u32 Vfmc_Mezz_HdmiTxRefClock_Sel(XVfmc *VfmcPtr, XVfmc_Mezz_TxRefClkSel Sel)
{
	u32 Status = XST_SUCCESS;
	void *IicPtr = VfmcPtr->IicPtr;
	Vfmc_I2cMuxSelect(VfmcPtr);

	if (Sel == VFMC_MEZZ_TxRefclk_From_IDT) {
		Status = Vfmc_ModifyRegister(IicPtr, VFMC_I2C_IOEXP_1_ADDR,
						0x1A, 0x08);
		Status |= Vfmc_ModifyRegister(IicPtr, VFMC_I2C_IOEXP_0_ADDR,
						0x41, 0x60);

	} else if (Sel == VFMC_MEZZ_TxRefclk_From_Si5344) {
		Status = Vfmc_ModifyRegister(IicPtr, VFMC_I2C_IOEXP_1_ADDR,
						0x12, 0x08);
		Status |= Vfmc_ModifyRegister(IicPtr, VFMC_I2C_IOEXP_0_ADDR,
						0x01, 0x60);
	} else{
		xil_printf("Invalid TX Ref clock selected.\r\n");
		return XST_FAILURE;
	}

	if (Status == XST_FAILURE) {
		xil_printf("Failed to select TX Ref clock.\r\n");
	}
	return Status;
}
/*****************************************************************************/
/**
*
* This function selects the TX ref clock on GTYE4 devices
*
* @param  Source of ref clock
*
* @return XST_SUCCESS if the ref clock source is successfuly set.
*         XST_FAILURE otherwise.
*
* @note   None.
*
******************************************************************************/
This function selects the TX ref clock on GTYE4 devices
This function selects the TX ref clock on GTYE4 devices
u32 Vfmc_Mezz_HdmiTxRefClock_Sel(XVfmc *VfmcPtr, XVfmc_Mezz_TxRefClkSel Sel)
{
	u32 Status = XST_SUCCESS;
	void *IicPtr = VfmcPtr->IicPtr;
	Vfmc_I2cMuxSelect(VfmcPtr);
	if (Sel == VFMC_MEZZ_TxRefclk_From_IDT) {
		Status = Vfmc_ModifyRegister(IicPtr, VFMC_I2C_IOEXP_1_ADDR,
						0x1A, 0x08);
		Status |= Vfmc_ModifyRegister(IicPtr, VFMC_I2C_IOEXP_0_ADDR,
						0x41, 0x60);
	} else if (Sel == VFMC_MEZZ_TxRefclk_From_Si5344) {
		Status = Vfmc_ModifyRegister(IicPtr, VFMC_I2C_IOEXP_1_ADDR,
						0x12, 0x08);
		Status |= Vfmc_ModifyRegister(IicPtr, VFMC_I2C_IOEXP_0_ADDR,
						0x01, 0x60);
	} else{
		xil_printf("Invalid TX Ref clock selected.\r\n");
		return XST_FAILURE;
	}
	if (Status == XST_FAILURE) {
		xil_printf("Failed to select TX Ref clock.\r\n");
	}
	return Status;
}
u32 Vfmc_Mezz_HdmiTxRefClock_Sel ( XVfmc * VfmcPtr , XVfmc_Mezz_TxRefClkSel Sel ) { u32 Status = XST_SUCCESS ; void * IicPtr = VfmcPtr -> IicPtr ; Vfmc_I2cMuxSelect ( VfmcPtr ) ; if ( Sel == VFMC_MEZZ_TxRefclk_From_IDT ) { Status = Vfmc_ModifyRegister ( IicPtr , VFMC_I2C_IOEXP_1_ADDR , 0x1A , 0x08 ) ; Status |= Vfmc_ModifyRegister ( IicPtr , VFMC_I2C_IOEXP_0_ADDR , 0x41 , 0x60 ) ; } else if ( Sel == VFMC_MEZZ_TxRefclk_From_Si5344 ) { Status = Vfmc_ModifyRegister ( IicPtr , VFMC_I2C_IOEXP_1_ADDR , 0x12 , 0x08 ) ; Status |= Vfmc_ModifyRegister ( IicPtr , VFMC_I2C_IOEXP_0_ADDR , 0x01 , 0x60 ) ; } else { xil_printf ( " \r \n " ) ; return XST_FAILURE ; } if ( Status == XST_FAILURE ) { xil_printf ( " \r \n " ) ; } return Status ; }
This function selects the TX ref clock on GTYE4 devices
This function selects the TX ref clock on GTYE4 devices