XilinxProcessorIPLib/drivers/v_hdmitxss1/examples/xhdmi_example/video_fmc.c
static int Vfmc_ModifyRegister(void *IicPtr, u8 SlaveAddr, u8 Value, u8 Mask)
{
	u8 Data;
	int ByteCount;

	/* Read data */
	ByteCount = Vfmc_I2cRecv(IicPtr, SlaveAddr, (u8 *)&Data, 1, I2C_STOP);

	/* Clear masked bits */
	Data &= ~Mask;

	/* Update */
	Data |= (Value & Mask);

	/* Write data */
	ByteCount +=
		Vfmc_I2cSend(IicPtr, SlaveAddr, (u8 *)&Data, 1, (I2C_STOP));

	if (ByteCount == 2)
	  return XST_SUCCESS;
	else
	  return XST_FAILURE;
}
/*****************************************************************************/
/**
*
* This function modifies 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 modifies a single byte to the TI LMK03318
This function modifies a single byte to the TI LMK03318
static int Vfmc_ModifyRegister(void *IicPtr, u8 SlaveAddr, u8 Value, u8 Mask)
{
	u8 Data;
	int ByteCount;
	ByteCount = Vfmc_I2cRecv(IicPtr, SlaveAddr, (u8 *)&Data, 1, I2C_STOP);
	Data &= ~Mask;
	Data |= (Value & Mask);
	ByteCount +=
		Vfmc_I2cSend(IicPtr, SlaveAddr, (u8 *)&Data, 1, (I2C_STOP));
	if (ByteCount == 2)
	  return XST_SUCCESS;
	else
	  return XST_FAILURE;
}
static int Vfmc_ModifyRegister ( void * IicPtr , u8 SlaveAddr , u8 Value , u8 Mask ) { u8 Data ; int ByteCount ; ByteCount = Vfmc_I2cRecv ( IicPtr , SlaveAddr , ( u8 * ) & Data , 1 , I2C_STOP ) ; Data &= ~ Mask ; Data |= ( Value & Mask ) ; ByteCount += Vfmc_I2cSend ( IicPtr , SlaveAddr , ( u8 * ) & Data , 1 , ( I2C_STOP ) ) ; if ( ByteCount == 2 ) return XST_SUCCESS ; else return XST_FAILURE ; }
This function modifies a single byte to the TI LMK03318
This function modifies a single byte to the TI LMK03318
/* Read data */ /* Clear masked bits */ /* Update */ /* Write data */