XilinxProcessorIPLib/drivers/dp14txss/examples/src/dats_dp14/idt_8t49n24x.c
static int IDT_8T49N24x_SetRegister(u32 I2CBaseAddress, u8 I2CSlaveAddress, u16 RegisterAddress, u8 Value)
{
	u32 ByteCount = 0;
	u8 Buffer[3];
	u8 Retry = 0;

	// Write data
	Buffer[0] = (RegisterAddress >> 8);
	Buffer[1] = RegisterAddress & 0xff;
	Buffer[2] = Value;

	while (1) {
		ByteCount = XIic_Send(I2CBaseAddress, I2CSlaveAddress, (u8*)Buffer, 3, XIIC_STOP);

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

			// Maximum retries
			if (Retry == 255) {
				return XST_FAILURE;
			}
		}

		else {
			return XST_SUCCESS;
		}
	}
}
/*****************************************************************************/
/**
*
* This function send a single byte to the IDT 8T49N24x
*
* @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 send a single byte to the IDT 8T49N24x
This function send a single byte to the IDT 8T49N24x
static int IDT_8T49N24x_SetRegister(u32 I2CBaseAddress, u8 I2CSlaveAddress, u16 RegisterAddress, u8 Value)
{
	u32 ByteCount = 0;
	u8 Buffer[3];
	u8 Retry = 0;
	Buffer[0] = (RegisterAddress >> 8);
	Buffer[1] = RegisterAddress & 0xff;
	Buffer[2] = Value;
	while (1) {
		ByteCount = XIic_Send(I2CBaseAddress, I2CSlaveAddress, (u8*)Buffer, 3, XIIC_STOP);
		if (ByteCount != 3) {
			Retry++;
			if (Retry == 255) {
				return XST_FAILURE;
			}
		}
		else {
			return XST_SUCCESS;
		}
	}
}
static int IDT_8T49N24x_SetRegister ( u32 I2CBaseAddress , u8 I2CSlaveAddress , u16 RegisterAddress , u8 Value ) { u32 ByteCount = 0 ; u8 Buffer [ 3 ] ; u8 Retry = 0 ; Buffer [ 0 ] = ( RegisterAddress >> 8 ) ; Buffer [ 1 ] = RegisterAddress & 0xff ; Buffer [ 2 ] = Value ; while ( 1 ) { ByteCount = XIic_Send ( I2CBaseAddress , I2CSlaveAddress , ( u8 * ) Buffer , 3 , XIIC_STOP ) ; if ( ByteCount != 3 ) { Retry ++ ; if ( Retry == 255 ) { return XST_FAILURE ; } } else { return XST_SUCCESS ; } } }
This function send a single byte to the IDT 8T49N24x
This function send a single byte to the IDT 8T49N24x
// Write data // Maximum retries