XilinxProcessorIPLib/drivers/dfeccf/examples/xdfesi570_mgt.c
static int XDfeSi570_I2CRdData_sub(int File, u8 Addr, u8 *Val, u8 Len)
{
	int Return = XST_SUCCESS;
	struct i2c_rdwr_ioctl_data Packets;
	struct i2c_msg Messages;
	Messages.addr = Addr;
	Messages.flags = I2C_M_RD;
	Messages.len = Len;
	Messages.buf = Val;
	Packets.msgs = &Messages;
	Packets.nmsgs = 1U;
	if (ioctl(File, I2C_RDWR, &Packets) < 0) {
		Return = XST_FAILURE;
	}
	return Return;
}
/****************************************************************************/
/**
*
* This function is HAL API for I2C read.
*
* @param File is descriptor for the I2C driver.
* @param Addr is address to be read.
* @param Val is read value.
* @param Len is data length.
*
* @return
*	- XST_SUCCESS if successful.
*	- XST_FAILURE if failed.
*
* @note		None
*
****************************************************************************/
This function is HAL API for I2C read.
This function is HAL API for I2C read .
static int XDfeSi570_I2CRdData_sub(int File, u8 Addr, u8 *Val, u8 Len)
{
	int Return = XST_SUCCESS;
	struct i2c_rdwr_ioctl_data Packets;
	struct i2c_msg Messages;
	Messages.addr = Addr;
	Messages.flags = I2C_M_RD;
	Messages.len = Len;
	Messages.buf = Val;
	Packets.msgs = &Messages;
	Packets.nmsgs = 1U;
	if (ioctl(File, I2C_RDWR, &Packets) < 0) {
		Return = XST_FAILURE;
	}
	return Return;
}
static int XDfeSi570_I2CRdData_sub ( int File , u8 Addr , u8 * Val , u8 Len ) { int Return = XST_SUCCESS ; struct i2c_rdwr_ioctl_data Packets ; struct i2c_msg Messages ; Messages . addr = Addr ; Messages . flags = I2C_M_RD ; Messages . len = Len ; Messages . buf = Val ; Packets . msgs = & Messages ; Packets . nmsgs = 1U ; if ( ioctl ( File , I2C_RDWR , & Packets ) < 0 ) { Return = XST_FAILURE ; } return Return ; }
This function is HAL API for I2C read.
This function is HAL API for I2C read .