XilinxProcessorIPLib/drivers/dp14txss/examples/src/pt_only/xdptxss_dp14_pt.c
int TI_LMK03318_SetRegister(u32 I2CBaseAddress, u8 I2CSlaveAddress,
			u8 RegisterAddress, u8 Value)
{
	u32 ByteCount = 0;
	u8 Buffer[2];
	u32 Status;

	Buffer[0] = RegisterAddress;
	Buffer[1] = Value;
#ifdef versal
	Status = XIicPs_MasterSendPolled(&Ps_Iic1,
		                                             (u8 *)&Buffer,
		                                             2,
													 I2CSlaveAddress);
	if(Status == XST_SUCCESS)
	{
		ByteCount = 2;
	}
#else
	ByteCount = XIic_Send(I2CBaseAddress, I2CSlaveAddress,
			      (u8*)Buffer, 2, XIIC_STOP);
#endif

	if (ByteCount != 2) {
		return XST_FAILURE;
	} else {
		return XST_SUCCESS;
	}
}
/*****************************************************************************/
/**
*
* This function send a single byte to the TI LMK03318
*
* @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 send a single byte to the TI LMK03318
This function send a single byte to the TI LMK03318
int TI_LMK03318_SetRegister(u32 I2CBaseAddress, u8 I2CSlaveAddress,
			u8 RegisterAddress, u8 Value)
{
	u32 ByteCount = 0;
	u8 Buffer[2];
	u32 Status;
	Buffer[0] = RegisterAddress;
	Buffer[1] = Value;
#ifdef versal
	Status = XIicPs_MasterSendPolled(&Ps_Iic1,
		                                             (u8 *)&Buffer,
		                                             2,
													 I2CSlaveAddress);
	if(Status == XST_SUCCESS)
	{
		ByteCount = 2;
	}
#else
	ByteCount = XIic_Send(I2CBaseAddress, I2CSlaveAddress,
			      (u8*)Buffer, 2, XIIC_STOP);
#endif
	if (ByteCount != 2) {
		return XST_FAILURE;
	} else {
		return XST_SUCCESS;
	}
}
int TI_LMK03318_SetRegister ( u32 I2CBaseAddress , u8 I2CSlaveAddress , u8 RegisterAddress , u8 Value ) { u32 ByteCount = 0 ; u8 Buffer [ 2 ] ; u32 Status ; Buffer [ 0 ] = RegisterAddress ; Buffer [ 1 ] = Value ; #ifdef versal Status = XIicPs_MasterSendPolled ( & Ps_Iic1 , ( u8 * ) & Buffer , 2 , I2CSlaveAddress ) ; if ( Status == XST_SUCCESS ) { ByteCount = 2 ; } #else ByteCount = XIic_Send ( I2CBaseAddress , I2CSlaveAddress , ( u8 * ) Buffer , 2 , XIIC_STOP ) ; #endif if ( ByteCount != 2 ) { return XST_FAILURE ; } else { return XST_SUCCESS ; } }
This function send a single byte to the TI LMK03318
This function send a single byte to the TI LMK03318