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

	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;
	switch(RxRefClk) {
	case FREQ_SI570_148_5_MHz:
		buf[i+1] = 0x26;
		break;
	case FREQ_SI570_148_35_MHz:
		buf[i+1] = 0x10;
		break;
	default:
		buf[i+1] = 0x26;
		break;
	}

	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 Si570 clock to 148.5MHz
 */
Set the Si570 clock to 148.5MHz
Set the Si570 clock to 148 . 5MHz
int Si570_SetClock(u32 IICBaseAddress, u8 IICAddress1, u32 RxRefClk) {
	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;
	switch(RxRefClk) {
	case FREQ_SI570_148_5_MHz:
		buf[i+1] = 0x26;
		break;
	case FREQ_SI570_148_35_MHz:
		buf[i+1] = 0x10;
		break;
	default:
		buf[i+1] = 0x26;
		break;
	}
	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 , u32 RxRefClk ) { 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 ; switch ( RxRefClk ) { case FREQ_SI570_148_5_MHz : buf [ i + 1 ] = 0x26 ; break ; case FREQ_SI570_148_35_MHz : buf [ i + 1 ] = 0x10 ; break ; default : buf [ i + 1 ] = 0x26 ; break ; } 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 Si570 clock to 148.5MHz
Set the Si570 clock to 148 . 5MHz
/* Need to set 8 registers */ /*
	 * Set the clock settings
	 */ /* Free running mode or use a reference clock */ /* Send all register settings to the Si5324 */