XilinxProcessorIPLib/drivers/dp14txss/examples/src/kcu_dp14/si_5344.c
int SI_5344_SetRegister(u32 I2CBaseAddress, u8 I2CSlaveAddress,
			u16 RegisterAddress, u8 Value)
{
	u32 ByteCount = 0;
	u8 Buffer[2];
	
	Buffer[0] = 0x01;	// Set page address
	Buffer[1] = (RegisterAddress >> 8) & 0xFF; 

	ByteCount = XIic_Send(I2CBaseAddress, I2CSlaveAddress,
			      (u8*)Buffer, 2, XIIC_STOP);

	if (ByteCount != 2) 
		return XST_FAILURE;

	Buffer[0] = RegisterAddress & 0xFF; 
	Buffer[1] = Value; 
	ByteCount = XIic_Send(I2CBaseAddress, I2CSlaveAddress,
			      (u8*)Buffer, 2, XIIC_STOP);
	
	if (ByteCount != 2) 
		return XST_FAILURE;

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function sets a register in the SI 5344  
*
* @param I2CBaseAddress is the baseaddress of the I2C core.
* @param I2CSlaveAddress is the 7-bit I2C slave address.
*
* @return
*    - XST_SUCCESS Initialization was successful.
*    - XST_FAILURE I2C write error.
*
* @note None.
*
******************************************************************************/
This function sets a register in the SI 5344
This function sets a register in the SI 5344
int SI_5344_SetRegister(u32 I2CBaseAddress, u8 I2CSlaveAddress,
			u16 RegisterAddress, u8 Value)
{
	u32 ByteCount = 0;
	u8 Buffer[2];
	Buffer[0] = 0x01;	
	Buffer[1] = (RegisterAddress >> 8) & 0xFF; 
	ByteCount = XIic_Send(I2CBaseAddress, I2CSlaveAddress,
			      (u8*)Buffer, 2, XIIC_STOP);
	if (ByteCount != 2) 
		return XST_FAILURE;
	Buffer[0] = RegisterAddress & 0xFF; 
	Buffer[1] = Value; 
	ByteCount = XIic_Send(I2CBaseAddress, I2CSlaveAddress,
			      (u8*)Buffer, 2, XIIC_STOP);
	if (ByteCount != 2) 
		return XST_FAILURE;
	return XST_SUCCESS;
}
int SI_5344_SetRegister ( u32 I2CBaseAddress , u8 I2CSlaveAddress , u16 RegisterAddress , u8 Value ) { u32 ByteCount = 0 ; u8 Buffer [ 2 ] ; Buffer [ 0 ] = 0x01 ; Buffer [ 1 ] = ( RegisterAddress >> 8 ) & 0xFF ; ByteCount = XIic_Send ( I2CBaseAddress , I2CSlaveAddress , ( u8 * ) Buffer , 2 , XIIC_STOP ) ; if ( ByteCount != 2 ) return XST_FAILURE ; Buffer [ 0 ] = RegisterAddress & 0xFF ; Buffer [ 1 ] = Value ; ByteCount = XIic_Send ( I2CBaseAddress , I2CSlaveAddress , ( u8 * ) Buffer , 2 , XIIC_STOP ) ; if ( ByteCount != 2 ) return XST_FAILURE ; return XST_SUCCESS ; }
This function sets a register in the SI 5344
This function sets a register in the SI 5344
// Set page address