XilinxProcessorIPLib/drivers/v_sdirxss/examples/xuhdsdi_example/xuhdsdi_example.c
static int I2cClk(u32 InFreq, u32 OutFreq)
{
	int Status;

	/* Free running mode */
	if (!InFreq) {

		Status = Si5324_SetClock((XPAR_IIC_0_BASEADDR),
					(I2C_CLK_ADDR),
					(SI5324_CLKSRC_XTAL),
					(SI5324_XTAL_FREQ),
					OutFreq);

		if (Status != (SI5324_SUCCESS)) {
			print("Error programming SI5324\n\r");
			return XST_FAILURE;
		}
	}

	/* Locked mode */
	else {
		Status = Si5324_SetClock((XPAR_IIC_0_BASEADDR),
					(I2C_CLK_ADDR),
					(SI5324_CLKSRC_CLK1),
					InFreq,
					OutFreq);

		if (Status != (SI5324_SUCCESS)) {
			print("Error programming SI5324\n\r");
			return XST_FAILURE;
		}
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
 *
 * This function setup SI5324 clock generator either in free or locked mode.
 *
 * @param	InFreq specifies an input frequency for the si5324.
 * @param	OutFreq specifies the output frequency of si5324.
 *
 * @return	'XST_FAILURE' if error in programming external clock
 *			else 'XST_SUCCESS' if success
 *
 * @note	None.
 *
 ******************************************************************************/
This function setup SI5324 clock generator either in free or locked mode.
@param       InFreq specifies an input frequency for the si5324.
@param       OutFreq specifies the output frequency of si5324.

@return      'XST_FAILURE' if error in programming external clock
else 'XST_SUCCESS' if success

@note        None.
This function setup SI5324 clock generator either in free or locked mode . @param InFreq specifies an input frequency for the si5324 . @param OutFreq specifies the output frequency of si5324 . @return ' XST_FAILURE ' if error in programming external clock else ' XST_SUCCESS ' if success @note None .
static int I2cClk(u32 InFreq, u32 OutFreq)
{
	int Status;
	if (!InFreq) {
		Status = Si5324_SetClock((XPAR_IIC_0_BASEADDR),
					(I2C_CLK_ADDR),
					(SI5324_CLKSRC_XTAL),
					(SI5324_XTAL_FREQ),
					OutFreq);
		if (Status != (SI5324_SUCCESS)) {
			print("Error programming SI5324\n\r");
			return XST_FAILURE;
		}
	}
	else {
		Status = Si5324_SetClock((XPAR_IIC_0_BASEADDR),
					(I2C_CLK_ADDR),
					(SI5324_CLKSRC_CLK1),
					InFreq,
					OutFreq);
		if (Status != (SI5324_SUCCESS)) {
			print("Error programming SI5324\n\r");
			return XST_FAILURE;
		}
	}
	return XST_SUCCESS;
}
static int I2cClk ( u32 InFreq , u32 OutFreq ) { int Status ; if ( ! InFreq ) { Status = Si5324_SetClock ( ( XPAR_IIC_0_BASEADDR ) , ( I2C_CLK_ADDR ) , ( SI5324_CLKSRC_XTAL ) , ( SI5324_XTAL_FREQ ) , OutFreq ) ; if ( Status != ( SI5324_SUCCESS ) ) { print ( " \n \r " ) ; return XST_FAILURE ; } } else { Status = Si5324_SetClock ( ( XPAR_IIC_0_BASEADDR ) , ( I2C_CLK_ADDR ) , ( SI5324_CLKSRC_CLK1 ) , InFreq , OutFreq ) ; if ( Status != ( SI5324_SUCCESS ) ) { print ( " \n \r " ) ; return XST_FAILURE ; } } return XST_SUCCESS ; }
This function setup SI5324 clock generator either in free or locked mode.
This function setup SI5324 clock generator either in free or locked mode .
/* Free running mode */ /* Locked mode */