XilinxProcessorIPLib/drivers/v_sdirxss/examples/xuhdsdi_rx_example/si5324drv.c
int Si570_SetClock(u32 IICBaseAddress, u8 IICAddress1) {

	int result;
	u8  buf[9*2]; /* Need to set 8 registers */
	int i;

	/*
	 * Set the clock settings
	 */
	if (SI5324_DEBUG) {
		xil_printf("Si570: Programming frequency settings.\n");
	}
	i = 0;

	/* Free running mode or use a reference clock */
	buf[i] = 137;
	buf[i+1] = 0x10;

	i += 2;

	buf[i] = 7;
	buf[i+1] = 0x01;

	i += 2;

	buf[i] = 8;
	buf[i+1] = 0xC2;

	i += 2;

	buf[i] = 9;
	buf[i+1] = 0x99;

	i += 2;

	buf[i] = 10;
	buf[i+1] = 0x48;

	i += 2;

	buf[i] = 11;
	buf[i+1] = 0x26;

	i += 2;

	buf[i] = 12;
	buf[i+1] = 0xC4;

	i += 2;

	buf[i] = 137;
	buf[i+1] = 0x00;

	i +=2;

	buf[i] = 135;
	buf[i+1] = 0x40;

	i += 2;

	/* Send all register settings to the Si5324 */
	result = Si570_DoSettings(IICBaseAddress, IICAddress1, buf, i / 2);
	return result;
}
/*****************************************************************************/
/**
 * Set the output frequency of the Si570 clock generator.
 *
 * @param	IICBaseAddress contains the base address of the IIC master
 *		device.
 * @param	IICAddress1 contains the 7 bit IIC address of the Si5324 device.
 *
 * @return	SI5324_SUCCESS for success, SI5324_ERR_IIC for IIC access failure,
 *		SI5324_ERR_FREQ when the requested frequency cannot be generated,
 *		SI5324_ERR_PARM when the ClkSrc or ClkDest parameters are invalid
 *		or the ClkInFreq or ClkOutFreq are out of range.
 *****************************************************************************/
Set the output frequency of the Si570 clock generator.
@param       IICBaseAddress contains the base address of the IIC master
device.
@param       IICAddress1 contains the 7 bit IIC address of the Si5324 device.

@return      SI5324_SUCCESS for success, SI5324_ERR_IIC for IIC access failure,
SI5324_ERR_FREQ when the requested frequency cannot be generated,
SI5324_ERR_PARM when the ClkSrc or ClkDest parameters are invalid
or the ClkInFreq or ClkOutFreq are out of range.
Set the output frequency of the Si570 clock generator . @param IICBaseAddress contains the base address of the IIC master device . @param IICAddress1 contains the 7 bit IIC address of the Si5324 device . @return SI5324_SUCCESS for success SI5324_ERR_IIC for IIC access failure SI5324_ERR_FREQ when the requested frequency cannot be generated SI5324_ERR_PARM when the ClkSrc or ClkDest parameters are invalid or the ClkInFreq or ClkOutFreq are out of range .
int Si570_SetClock(u32 IICBaseAddress, u8 IICAddress1) {
	int result;
	u8  buf[9*2]; 
	int i;
	if (SI5324_DEBUG) {
		xil_printf("Si570: Programming frequency settings.\n");
	}
	i = 0;
	buf[i] = 137;
	buf[i+1] = 0x10;
	i += 2;
	buf[i] = 7;
	buf[i+1] = 0x01;
	i += 2;
	buf[i] = 8;
	buf[i+1] = 0xC2;
	i += 2;
	buf[i] = 9;
	buf[i+1] = 0x99;
	i += 2;
	buf[i] = 10;
	buf[i+1] = 0x48;
	i += 2;
	buf[i] = 11;
	buf[i+1] = 0x26;
	i += 2;
	buf[i] = 12;
	buf[i+1] = 0xC4;
	i += 2;
	buf[i] = 137;
	buf[i+1] = 0x00;
	i +=2;
	buf[i] = 135;
	buf[i+1] = 0x40;
	i += 2;
	result = Si570_DoSettings(IICBaseAddress, IICAddress1, buf, i / 2);
	return result;
}
int Si570_SetClock ( u32 IICBaseAddress , u8 IICAddress1 ) { int result ; u8 buf [ 9 * 2 ] ; int i ; if ( SI5324_DEBUG ) { xil_printf ( " \n " ) ; } i = 0 ; buf [ i ] = 137 ; buf [ i + 1 ] = 0x10 ; i += 2 ; buf [ i ] = 7 ; buf [ i + 1 ] = 0x01 ; i += 2 ; buf [ i ] = 8 ; buf [ i + 1 ] = 0xC2 ; i += 2 ; buf [ i ] = 9 ; buf [ i + 1 ] = 0x99 ; i += 2 ; buf [ i ] = 10 ; buf [ i + 1 ] = 0x48 ; i += 2 ; buf [ i ] = 11 ; buf [ i + 1 ] = 0x26 ; i += 2 ; buf [ i ] = 12 ; buf [ i + 1 ] = 0xC4 ; i += 2 ; buf [ i ] = 137 ; buf [ i + 1 ] = 0x00 ; i += 2 ; buf [ i ] = 135 ; buf [ i + 1 ] = 0x40 ; i += 2 ; result = Si570_DoSettings ( IICBaseAddress , IICAddress1 , buf , i / 2 ) ; return result ; }
Set the output frequency of the Si570 clock generator.
Set the output frequency of the Si570 clock generator .
/* Need to set 8 registers */ /*
	 * Set the clock settings
	 */ /* Free running mode or use a reference clock */ /* Send all register settings to the Si5324 */