XilinxProcessorIPLib/drivers/v_hdmitxss1/examples/xhdmi_example/si5324drv.c
int Si5324_DoSettings(void *IicPtr, u8 IICAddress,
                      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("Si5324: ERROR: Illegal number of registers to write.\r\n");
        }
        return SI5324_ERR_PARM;
    }

    for (i = 0; i < NumRegs; i++) {
        result = Si5324_I2cSend(IicPtr, IICAddress, BufPtr + (i << 1),
        									2, I2C_STOP);
        if (result != 2) {
            if (SI5324_DEBUG) {
                xil_printf("Si5324: ERROR: IIC write request error.\r\n");
            }
            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    IICAddress 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
 *           one.
 *
 * @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    IICAddress 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
one.

@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 IICAddress 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 one . @note Private function . Does not modify the contents of the buffer pointed to by BufPtr .
int Si5324_DoSettings(void *IicPtr, u8 IICAddress,
                      u8 *BufPtr, int NumRegs) {
    int result;
    int i;
    if (NumRegs < 1) {
        if (SI5324_DEBUG) {
            xil_printf("Si5324: ERROR: Illegal number of registers to write.\r\n");
        }
        return SI5324_ERR_PARM;
    }
    for (i = 0; i < NumRegs; i++) {
        result = Si5324_I2cSend(IicPtr, IICAddress, BufPtr + (i << 1),
        									2, I2C_STOP);
        if (result != 2) {
            if (SI5324_DEBUG) {
                xil_printf("Si5324: ERROR: IIC write request error.\r\n");
            }
            return SI5324_ERR_IIC;
        }
    }
    return SI5324_SUCCESS;
}
int Si5324_DoSettings ( void * IicPtr , u8 IICAddress , u8 * BufPtr , int NumRegs ) { int result ; int i ; if ( NumRegs < 1 ) { if ( SI5324_DEBUG ) { xil_printf ( " \r \n " ) ; } return SI5324_ERR_PARM ; } for ( i = 0 ; i < NumRegs ; i ++ ) { result = Si5324_I2cSend ( IicPtr , IICAddress , BufPtr + ( i << 1 ) , 2 , I2C_STOP ) ; if ( result != 2 ) { if ( SI5324_DEBUG ) { xil_printf ( " \r \n " ) ; } 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.