XilinxProcessorIPLib/drivers/v_sdirxss/examples/xuhdsdi_rx_example/si5324drv.c
int Si570_DoSettings(u32 IICBaseAddress, u8 IICAddress1,
		u8 *BufPtr, int NumRegs) {
	int result;
	int i;

	/* Check the number of registers to write. It must be at least one. */
	if (NumRegs < 1) {
		if (SI5324_DEBUG) {
			xil_printf("Si570: ERROR: Illegal number of registers to write.");
		}
		return SI5324_ERR_PARM;
	}
	for (i = 0; i < NumRegs; i++) {
		result = XIic_Send(IICBaseAddress, IICAddress1,
					BufPtr + (i << 1), 2,
					XIIC_STOP);
		if (result != 2) {
			if (SI5324_DEBUG) {
				xil_printf("Si570: ERROR: IIC write request error.");
			}
			return SI5324_ERR_IIC;
		}
	}
	return SI5324_SUCCESS;
}
/*****************************************************************************/
/**
 * Send a list of register settings to the Si5324 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.
 * @param	BufPtr is a pointer to an array with alternating register addresses
 *		and register values to program into the Si5324. The array length
 *		must be at least 2*NumRegs.
 * @param	NumRegs contains the number of registers to write.
 *
 * @return	SI5324_SUCCESS for success, SI5324_ERR_IIC for IIC access failure,SI5324_ERR_PARM when the number of registers to write is less than
 *		SI5324_ERR_PARM when the number of registers to write is less than
 *
 * @note	Private function. Does not modify the contents of the buffer
 *		pointed to by BufPtr.
 *****************************************************************************/
Send a list of register settings to the Si5324 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.
@param       BufPtr is a pointer to an array with alternating register addresses
and register values to program into the Si5324. The array length
must be at least 2*NumRegs.
@param       NumRegs contains the number of registers to write.

@return      SI5324_SUCCESS for success, SI5324_ERR_IIC for IIC access failure,SI5324_ERR_PARM when the number of registers to write is less than
SI5324_ERR_PARM when the number of registers to write is less than

@note        Private function. Does not modify the contents of the buffer
pointed to by BufPtr.
Send a list of register settings to the Si5324 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 . @param BufPtr is a pointer to an array with alternating register addresses and register values to program into the Si5324 . The array length must be at least 2 * NumRegs . @param NumRegs contains the number of registers to write . @return SI5324_SUCCESS for success SI5324_ERR_IIC for IIC access failure SI5324_ERR_PARM when the number of registers to write is less than SI5324_ERR_PARM when the number of registers to write is less than @note Private function . Does not modify the contents of the buffer pointed to by BufPtr .
int Si570_DoSettings(u32 IICBaseAddress, u8 IICAddress1,
		u8 *BufPtr, int NumRegs) {
	int result;
	int i;
	if (NumRegs < 1) {
		if (SI5324_DEBUG) {
			xil_printf("Si570: ERROR: Illegal number of registers to write.");
		}
		return SI5324_ERR_PARM;
	}
	for (i = 0; i < NumRegs; i++) {
		result = XIic_Send(IICBaseAddress, IICAddress1,
					BufPtr + (i << 1), 2,
					XIIC_STOP);
		if (result != 2) {
			if (SI5324_DEBUG) {
				xil_printf("Si570: ERROR: IIC write request error.");
			}
			return SI5324_ERR_IIC;
		}
	}
	return SI5324_SUCCESS;
}
int Si570_DoSettings ( u32 IICBaseAddress , u8 IICAddress1 , u8 * BufPtr , int NumRegs ) { int result ; int i ; if ( NumRegs < 1 ) { if ( SI5324_DEBUG ) { xil_printf ( " " ) ; } return SI5324_ERR_PARM ; } for ( i = 0 ; i < NumRegs ; i ++ ) { result = XIic_Send ( IICBaseAddress , IICAddress1 , BufPtr + ( i << 1 ) , 2 , XIIC_STOP ) ; if ( result != 2 ) { if ( SI5324_DEBUG ) { xil_printf ( " " ) ; } return SI5324_ERR_IIC ; } } return SI5324_SUCCESS ; }
Send a list of register settings to the Si5324 clock generator.
Send a list of register settings to the Si5324 clock generator .
/* Check the number of registers to write. It must be at least one. */