XilinxProcessorIPLib/drivers/dp14txss/examples/src/dats_dp14/idt_8t49n24x.c
static int IDT_8T49N24x_CheckDeviceID(u32 I2CBaseAddress, u8 I2CSlaveAddress)
{
	u16 DeviceId;
	u8 Data;

	// Get DEV_ID[15:12]
	Data = IDT_8T49N24x_GetRegister(I2CBaseAddress, I2CSlaveAddress, 0x0002);

	// Mask
	Data &= 0x0f;

	// Copy
	DeviceId = Data;

	// Shift
	DeviceId <<= 8;

	// Get DEV_ID[11:4]
	Data = IDT_8T49N24x_GetRegister(I2CBaseAddress, I2CSlaveAddress, 0x0003);

	// Copy
	DeviceId |= Data;

	// Shift
	DeviceId <<= 4;

	// Get DEV_ID[3:0]
	Data = IDT_8T49N24x_GetRegister(I2CBaseAddress, I2CSlaveAddress, 0x0004);

	// Copy
	DeviceId |= (Data >> 4);

	// Check
	if (DeviceId == 0x0606)
		return XST_SUCCESS;

	else
		return XST_FAILURE;
}
/*****************************************************************************/
/**
*
* This function checks the IDT 8T49N24x device ID
*
* @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 checks the IDT 8T49N24x device ID
This function checks the IDT 8T49N24x device ID
static int IDT_8T49N24x_CheckDeviceID(u32 I2CBaseAddress, u8 I2CSlaveAddress)
{
	u16 DeviceId;
	u8 Data;
	Data = IDT_8T49N24x_GetRegister(I2CBaseAddress, I2CSlaveAddress, 0x0002);
	Data &= 0x0f;
	DeviceId = Data;
	DeviceId <<= 8;
	Data = IDT_8T49N24x_GetRegister(I2CBaseAddress, I2CSlaveAddress, 0x0003);
	DeviceId |= Data;
	DeviceId <<= 4;
	Data = IDT_8T49N24x_GetRegister(I2CBaseAddress, I2CSlaveAddress, 0x0004);
	DeviceId |= (Data >> 4);
	if (DeviceId == 0x0606)
		return XST_SUCCESS;
	else
		return XST_FAILURE;
}
static int IDT_8T49N24x_CheckDeviceID ( u32 I2CBaseAddress , u8 I2CSlaveAddress ) { u16 DeviceId ; u8 Data ; Data = IDT_8T49N24x_GetRegister ( I2CBaseAddress , I2CSlaveAddress , 0x0002 ) ; Data &= 0x0f ; DeviceId = Data ; DeviceId <<= 8 ; Data = IDT_8T49N24x_GetRegister ( I2CBaseAddress , I2CSlaveAddress , 0x0003 ) ; DeviceId |= Data ; DeviceId <<= 4 ; Data = IDT_8T49N24x_GetRegister ( I2CBaseAddress , I2CSlaveAddress , 0x0004 ) ; DeviceId |= ( Data >> 4 ) ; if ( DeviceId == 0x0606 ) return XST_SUCCESS ; else return XST_FAILURE ; }
This function checks the IDT 8T49N24x device ID
This function checks the IDT 8T49N24x device ID
// Get DEV_ID[15:12] // Mask // Copy // Shift // Get DEV_ID[11:4] // Copy // Shift // Get DEV_ID[3:0] // Copy // Check