XilinxProcessorIPLib/drivers/dp14txss/examples/src/dats_dp14/idt_8t49n24x.c
int IDT_8T49N24x_Init(u32 I2CBaseAddress, u8 I2CSlaveAddress)
{
	int Result=0;

	// Check device ID
//	Result = IDT_8T49N24x_CheckDeviceID(I2CBaseAddress, I2CSlaveAddress);


	if (Result == XST_SUCCESS){

		// Disable DPLL and APLL calibration
		// The i2c interface is clocked by the APLL.
		// During the PLL parameters update, the i2c might become unresponsive.
		// To prevent this, the DPLL and APLL calibration are disabled during the i2c transactions
		//MB_Sleep(300);
		usleep(300);
		Result = IDT_8T49N24x_Enable(I2CBaseAddress, I2CSlaveAddress, FALSE);
		//MB_Sleep(300);
		usleep(300);

		// Configure device
		Result = IDT_8T49N24x_Configure_JA(I2CBaseAddress, I2CSlaveAddress);
		//MB_Sleep(300);
		usleep(300);

		// Enable DPLL and APLL calibration
		Result = IDT_8T49N24x_Enable(I2CBaseAddress, I2CSlaveAddress, TRUE);
		//MB_Sleep(300);
		usleep(300);
///*
//
//		// Set GPIO
//		Result = IDT_8T49N24x_GPIO(I2CBaseAddress, I2CSlaveAddress);
//
//		// Disable output 0
//		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 0, FALSE);
//
//		// Disable output 1
//		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 1, FALSE);
//
//		// Enable output 2
//		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 2, TRUE);
//
//		// Enable output 3
//		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 3, TRUE);
//
//		// Lock mode
//		Result = IDT_8T49N24x_LockMode(I2CBaseAddress, I2CSlaveAddress);
//
//		// Select clock input 0
//		Result = IDT_8T49N24x_SelectInputReference(I2CBaseAddress, I2CSlaveAddress, 0);
//
//		return XST_SUCCESS;
//
//*/
	return Result;
	}

	return XST_FAILURE;
}
/*****************************************************************************/
/**
*
* This function initializes the IDT 8TN49N24x with default values
* for use with the Video FMC.
*
* @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 initializes the IDT 8TN49N24x with default values
for use with the Video FMC.
This function initializes the IDT 8TN49N24x with default values for use with the Video FMC .
int IDT_8T49N24x_Init(u32 I2CBaseAddress, u8 I2CSlaveAddress)
{
	int Result=0;
	if (Result == XST_SUCCESS){
		usleep(300);
		Result = IDT_8T49N24x_Enable(I2CBaseAddress, I2CSlaveAddress, FALSE);
		usleep(300);
		Result = IDT_8T49N24x_Configure_JA(I2CBaseAddress, I2CSlaveAddress);
		usleep(300);
		Result = IDT_8T49N24x_Enable(I2CBaseAddress, I2CSlaveAddress, TRUE);
		usleep(300);
		 Set GPIO
		Result = IDT_8T49N24x_GPIO(I2CBaseAddress, I2CSlaveAddress);
		 Disable output 0
		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 0, FALSE);
		 Disable output 1
		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 1, FALSE);
		 Enable output 2
		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 2, TRUE);
		 Enable output 3
		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 3, TRUE);
		 Lock mode
		Result = IDT_8T49N24x_LockMode(I2CBaseAddress, I2CSlaveAddress);
		 Select clock input 0
		Result = IDT_8T49N24x_SelectInputReference(I2CBaseAddress, I2CSlaveAddress, 0);
		return XST_SUCCESS;
*/
	return Result;
	}
	return XST_FAILURE;
}
int IDT_8T49N24x_Init ( u32 I2CBaseAddress , u8 I2CSlaveAddress ) { int Result = 0 ; if ( Result == XST_SUCCESS ) { usleep ( 300 ) ; Result = IDT_8T49N24x_Enable ( I2CBaseAddress , I2CSlaveAddress , FALSE ) ; usleep ( 300 ) ; Result = IDT_8T49N24x_Configure_JA ( I2CBaseAddress , I2CSlaveAddress ) ; usleep ( 300 ) ; Result = IDT_8T49N24x_Enable ( I2CBaseAddress , I2CSlaveAddress , TRUE ) ; usleep ( 300 ) ; return Result ; } return XST_FAILURE ; }
This function initializes the IDT 8TN49N24x with default values
for use with the Video FMC.
This function initializes the IDT 8TN49N24x with default values for use with the Video FMC .
// Check device ID //	Result = IDT_8T49N24x_CheckDeviceID(I2CBaseAddress, I2CSlaveAddress); // Disable DPLL and APLL calibration // The i2c interface is clocked by the APLL. // During the PLL parameters update, the i2c might become unresponsive. // To prevent this, the DPLL and APLL calibration are disabled during the i2c transactions //MB_Sleep(300); //MB_Sleep(300); // Configure device //MB_Sleep(300); // Enable DPLL and APLL calibration //MB_Sleep(300); ///* // //		// Set GPIO //		Result = IDT_8T49N24x_GPIO(I2CBaseAddress, I2CSlaveAddress); // //		// Disable output 0 //		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 0, FALSE); // //		// Disable output 1 //		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 1, FALSE); // //		// Enable output 2 //		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 2, TRUE); // //		// Enable output 3 //		Result = IDT_8T49N24x_OutputDriver(I2CBaseAddress, I2CSlaveAddress, 3, TRUE); // //		// Lock mode //		Result = IDT_8T49N24x_LockMode(I2CBaseAddress, I2CSlaveAddress); // //		// Select clock input 0 //		Result = IDT_8T49N24x_SelectInputReference(I2CBaseAddress, I2CSlaveAddress, 0); // //		return XST_SUCCESS; // //*/