XilinxProcessorIPLib/drivers/v_hdmitxss1/examples/xhdmi_example/video_fmc.c
static unsigned Vfmc_I2cRecv(void *IicPtr, u16 SlaveAddr, u8 *BufPtr,
		unsigned ByteCount, u8 Option)
{
#if defined (XPS_BOARD_ZCU102) || \
	defined (XPS_BOARD_ZCU104) || \
	defined (XPS_BOARD_ZCU106) || \
    defined (XPS_BOARD_VCK190)
	XIicPs *Iic_Ptr = IicPtr;
	u32 Status;

	XIicPs_SetOptions(Iic_Ptr, XIICPS_7_BIT_ADDR_OPTION);
	XIicPs_ClearOptions(Iic_Ptr, XIICPS_10_BIT_ADDR_OPTION);
	if (Option == I2C_REPEATED_START) {
		XIicPs_SetOptions(Iic_Ptr, XIICPS_REP_START_OPTION);
	} else {
		XIicPs_ClearOptions(Iic_Ptr, XIICPS_REP_START_OPTION);
	}

	Status = XIicPs_MasterRecvPolled(Iic_Ptr, BufPtr, ByteCount,
			SlaveAddr);

	/*
	 * Wait until bus is idle to start another transfer.
	 */
	if (!(Iic_Ptr->IsRepeatedStart)) {
		while (XIicPs_BusIsBusy(Iic_Ptr));
	}

	if (Status == XST_SUCCESS) {
		return ByteCount;
	} else {
		return 0;
	}
#else
	XIic *Iic_Ptr = IicPtr;
	return XIic_Recv(Iic_Ptr->BaseAddress, SlaveAddr, BufPtr,
					ByteCount, Option);
#endif
}
/*****************************************************************************/
/**
*
* This function send the IIC data to Vfmc
*
* @param  IicPtr IIC instance pointer.
* @param  SlaveAddr contains the 7 bit IIC address of the device to send the
*		   specified data to.
* @param BufPtr points to the memory to write the data.
* @param ByteCount is the number of bytes to be sent.
* @param Option indicates whether to hold or free the bus after
* 		  transmitting the data.
*
* @return	The number of bytes sent.
*
* @return None.
*
* @note   None.
*
******************************************************************************/
This function send the IIC data to Vfmc
This function send the IIC data to Vfmc
static unsigned Vfmc_I2cRecv(void *IicPtr, u16 SlaveAddr, u8 *BufPtr,
		unsigned ByteCount, u8 Option)
{
#if defined (XPS_BOARD_ZCU102) || \
	defined (XPS_BOARD_ZCU104) || \
	defined (XPS_BOARD_ZCU106) || \
    defined (XPS_BOARD_VCK190)
	XIicPs *Iic_Ptr = IicPtr;
	u32 Status;
	XIicPs_SetOptions(Iic_Ptr, XIICPS_7_BIT_ADDR_OPTION);
	XIicPs_ClearOptions(Iic_Ptr, XIICPS_10_BIT_ADDR_OPTION);
	if (Option == I2C_REPEATED_START) {
		XIicPs_SetOptions(Iic_Ptr, XIICPS_REP_START_OPTION);
	} else {
		XIicPs_ClearOptions(Iic_Ptr, XIICPS_REP_START_OPTION);
	}
	Status = XIicPs_MasterRecvPolled(Iic_Ptr, BufPtr, ByteCount,
			SlaveAddr);
	if (!(Iic_Ptr->IsRepeatedStart)) {
		while (XIicPs_BusIsBusy(Iic_Ptr));
	}
	if (Status == XST_SUCCESS) {
		return ByteCount;
	} else {
		return 0;
	}
#else
	XIic *Iic_Ptr = IicPtr;
	return XIic_Recv(Iic_Ptr->BaseAddress, SlaveAddr, BufPtr,
					ByteCount, Option);
#endif
}
static unsigned Vfmc_I2cRecv ( void * IicPtr , u16 SlaveAddr , u8 * BufPtr , unsigned ByteCount , u8 Option ) { #if defined ( XPS_BOARD_ZCU102 ) || defined ( XPS_BOARD_ZCU104 ) || defined ( XPS_BOARD_ZCU106 ) || defined ( XPS_BOARD_VCK190 ) XIicPs * Iic_Ptr = IicPtr ; u32 Status ; XIicPs_SetOptions ( Iic_Ptr , XIICPS_7_BIT_ADDR_OPTION ) ; XIicPs_ClearOptions ( Iic_Ptr , XIICPS_10_BIT_ADDR_OPTION ) ; if ( Option == I2C_REPEATED_START ) { XIicPs_SetOptions ( Iic_Ptr , XIICPS_REP_START_OPTION ) ; } else { XIicPs_ClearOptions ( Iic_Ptr , XIICPS_REP_START_OPTION ) ; } Status = XIicPs_MasterRecvPolled ( Iic_Ptr , BufPtr , ByteCount , SlaveAddr ) ; if ( ! ( Iic_Ptr -> IsRepeatedStart ) ) { while ( XIicPs_BusIsBusy ( Iic_Ptr ) ) ; } if ( Status == XST_SUCCESS ) { return ByteCount ; } else { return 0 ; } #else XIic * Iic_Ptr = IicPtr ; return XIic_Recv ( Iic_Ptr -> BaseAddress , SlaveAddr , BufPtr , ByteCount , Option ) ; #endif }
This function send the IIC data to Vfmc
This function send the IIC data to Vfmc
/*
	 * Wait until bus is idle to start another transfer.
	 */