XilinxProcessorIPLib/drivers/dp14rxss/examples/src/rx_only/xdprxss_dp14_rx.c
u8 i2c_read_dp141(u32 I2CBaseAddress, u8 I2CSlaveAddress,
		u16 RegisterAddress)
{
	u32 ByteCount = 0;
	u8 Buffer[1];
	u8 Data;
	u8 Retry = 0;
	u8 Exit;

	Exit = FALSE;
	Data = 0;

	do {
		/* Set Address */
//		Buffer[0] = (RegisterAddress >> 8);
		Buffer[0] = RegisterAddress & 0xff;
		ByteCount = XIic_Send(I2CBaseAddress, I2CSlaveAddress,
				      (u8*)Buffer, 1, XIIC_REPEATED_START);

		if (ByteCount != 1) {
			Retry++;

			/* Maximum retries */
			if (Retry == 255) {
				Exit = TRUE;
			}
		} else {
			/* Read data */
			ByteCount = XIic_Recv(I2CBaseAddress, I2CSlaveAddress,
					      (u8*)Buffer, 1, XIIC_STOP);
//			ByteCount = XIic_Recv(I2CBaseAddress, I2CSlaveAddress,
//					      (u8*)Buffer, 2, XIIC_STOP);
//			if (ByteCount != 1) {
//				Exit = FALSE;
//				Exit = TRUE;
//			} else {
				Data = Buffer[0];
				Exit = TRUE;
//			}
		}
	} while (!Exit);

	return Data;
}
/*****************************************************************************/
/**
*
* This function reads DP141 VFMC- IIC.
*
* @param    None.
*
* @return    None.
*
* @note        None.
*
******************************************************************************/
This function reads DP141 VFMC- IIC.
This function reads DP141 VFMC - IIC .
u8 i2c_read_dp141(u32 I2CBaseAddress, u8 I2CSlaveAddress,
		u16 RegisterAddress)
{
	u32 ByteCount = 0;
	u8 Buffer[1];
	u8 Data;
	u8 Retry = 0;
	u8 Exit;
	Exit = FALSE;
	Data = 0;
	do {
		Buffer[0] = RegisterAddress & 0xff;
		ByteCount = XIic_Send(I2CBaseAddress, I2CSlaveAddress,
				      (u8*)Buffer, 1, XIIC_REPEATED_START);
		if (ByteCount != 1) {
			Retry++;
			if (Retry == 255) {
				Exit = TRUE;
			}
		} else {
			ByteCount = XIic_Recv(I2CBaseAddress, I2CSlaveAddress,
					      (u8*)Buffer, 1, XIIC_STOP);
				Data = Buffer[0];
				Exit = TRUE;
		}
	} while (!Exit);
	return Data;
}
u8 i2c_read_dp141 ( u32 I2CBaseAddress , u8 I2CSlaveAddress , u16 RegisterAddress ) { u32 ByteCount = 0 ; u8 Buffer [ 1 ] ; u8 Data ; u8 Retry = 0 ; u8 Exit ; Exit = FALSE ; Data = 0 ; do { Buffer [ 0 ] = RegisterAddress & 0xff ; ByteCount = XIic_Send ( I2CBaseAddress , I2CSlaveAddress , ( u8 * ) Buffer , 1 , XIIC_REPEATED_START ) ; if ( ByteCount != 1 ) { Retry ++ ; if ( Retry == 255 ) { Exit = TRUE ; } } else { ByteCount = XIic_Recv ( I2CBaseAddress , I2CSlaveAddress , ( u8 * ) Buffer , 1 , XIIC_STOP ) ; Data = Buffer [ 0 ] ; Exit = TRUE ; } } while ( ! Exit ) ; return Data ; }
This function reads DP141 VFMC- IIC.
This function reads DP141 VFMC - IIC .
/* Set Address */ //		Buffer[0] = (RegisterAddress >> 8); /* Maximum retries */ /* Read data */ //			ByteCount = XIic_Recv(I2CBaseAddress, I2CSlaveAddress, //					      (u8*)Buffer, 2, XIIC_STOP); //			if (ByteCount != 1) { //				Exit = FALSE; //				Exit = TRUE; //			} else { //			}