XilinxProcessorIPLib/drivers/dp14txss/examples/src/dats_dp14/idt_8t49n24x.c
static int IDT_8T49N24x_OutputDriver(u32 I2CBaseAddress, u8 I2CSlaveAddress, u8 Output, u8 Enable)
{
	int Result;
	u8 Value;
	u8 Mask;
	u16 Address;
	u8 Shift;

	// OUTEN
	Mask = (1 << Output);
	if (Enable)
		Value = Mask;
	else
		Value = 0x00;

	Result = IDT_8T49N24x_ModifyRegister(I2CBaseAddress, I2CSlaveAddress, 0x0039, Value, Mask);

	// OUTMODE
	switch (Output) {
		case 0 :
			Address = 0x003e;
			Shift = 1;
			break;

		case 1 :
			Address = 0x003e;
			Shift = 5;
			break;

		case 2 :
			Address = 0x003d;
			Shift = 1;
			break;

		case 3 :
			Address = 0x003d;
			Shift = 5;
			break;
	}

	if (Enable)
		Value = 0x02;	// LVDS
	else
		Value = 0x00;	// High-impedance

	Value <<= Shift;
	Mask = (0x07 << Shift);

	Result = IDT_8T49N24x_ModifyRegister(I2CBaseAddress, I2CSlaveAddress, Address, Value, Mask);

	// Qm_DIS
	if (!Enable)
		Value = (1 << Output);
	else
		Value = 0;

	Mask = (1 << Output);

	Result = IDT_8T49N24x_ModifyRegister(I2CBaseAddress, I2CSlaveAddress, 0x006f, Value, Mask);

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function set the output drivers
*
* @param I2CBaseAddress is the baseaddress of the I2C core.
* @param I2CSlaveAddress is the 7-bit I2C slave address.
*
* @return
*    - XST_SUCCESS
*    - XST_FAILURE
*
* @note None.
*
******************************************************************************/
This function set the output drivers
This function set the output drivers
static int IDT_8T49N24x_OutputDriver(u32 I2CBaseAddress, u8 I2CSlaveAddress, u8 Output, u8 Enable)
{
	int Result;
	u8 Value;
	u8 Mask;
	u16 Address;
	u8 Shift;
	Mask = (1 << Output);
	if (Enable)
		Value = Mask;
	else
		Value = 0x00;
	Result = IDT_8T49N24x_ModifyRegister(I2CBaseAddress, I2CSlaveAddress, 0x0039, Value, Mask);
	switch (Output) {
		case 0 :
			Address = 0x003e;
			Shift = 1;
			break;
		case 1 :
			Address = 0x003e;
			Shift = 5;
			break;
		case 2 :
			Address = 0x003d;
			Shift = 1;
			break;
		case 3 :
			Address = 0x003d;
			Shift = 5;
			break;
	}
	if (Enable)
		Value = 0x02;	
	else
		Value = 0x00;	
	Value <<= Shift;
	Mask = (0x07 << Shift);
	Result = IDT_8T49N24x_ModifyRegister(I2CBaseAddress, I2CSlaveAddress, Address, Value, Mask);
	if (!Enable)
		Value = (1 << Output);
	else
		Value = 0;
	Mask = (1 << Output);
	Result = IDT_8T49N24x_ModifyRegister(I2CBaseAddress, I2CSlaveAddress, 0x006f, Value, Mask);
	return XST_SUCCESS;
}
static int IDT_8T49N24x_OutputDriver ( u32 I2CBaseAddress , u8 I2CSlaveAddress , u8 Output , u8 Enable ) { int Result ; u8 Value ; u8 Mask ; u16 Address ; u8 Shift ; Mask = ( 1 << Output ) ; if ( Enable ) Value = Mask ; else Value = 0x00 ; Result = IDT_8T49N24x_ModifyRegister ( I2CBaseAddress , I2CSlaveAddress , 0x0039 , Value , Mask ) ; switch ( Output ) { case 0 : Address = 0x003e ; Shift = 1 ; break ; case 1 : Address = 0x003e ; Shift = 5 ; break ; case 2 : Address = 0x003d ; Shift = 1 ; break ; case 3 : Address = 0x003d ; Shift = 5 ; break ; } if ( Enable ) Value = 0x02 ; else Value = 0x00 ; Value <<= Shift ; Mask = ( 0x07 << Shift ) ; Result = IDT_8T49N24x_ModifyRegister ( I2CBaseAddress , I2CSlaveAddress , Address , Value , Mask ) ; if ( ! Enable ) Value = ( 1 << Output ) ; else Value = 0 ; Mask = ( 1 << Output ) ; Result = IDT_8T49N24x_ModifyRegister ( I2CBaseAddress , I2CSlaveAddress , 0x006f , Value , Mask ) ; return XST_SUCCESS ; }
This function set the output drivers
This function set the output drivers
// OUTEN // OUTMODE // LVDS // High-impedance // Qm_DIS