XilinxProcessorIPLib/drivers/iic/examples/xiic_tenbitaddr_example.c
int TenBitAddrReadData(u8 *BufferPtr, u16 ByteCount)
{
	int Status;

	/*
	 * Set the defaults.
	 */
	ReceiveComplete = 1;

	/*
	 * Start the IIC device.
	 */
	Status = XIic_Start(&IicInstance);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Set the Global Interrupt Enable.
	 */
	XIic_IntrGlobalEnable(IicInstance.BaseAddress);

	/*
	 * Wait for AAS interrupt and completion of data reception.
	 */
	while ((ReceiveComplete) || (XIic_IsIicBusy(&IicInstance) == TRUE)) {
		if (SlaveRead) {
			XIic_SlaveRecv(&IicInstance, ReadBuffer, RECEIVE_COUNT);
			SlaveRead = 0;
		}
	}

	/*
	 * Disable the Global Interrupt Enable.
	 */
	XIic_IntrGlobalDisable(IicInstance.BaseAddress);

	/*
	 * Stop the IIC device.
	 */
	Status = XIic_Stop(&IicInstance);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
* This function reads a buffer of bytes  when the IIC Master on the bus writes
*  data to the slave device.
*
* @param	BufferPtr contains the address of the data buffer to be filled.
* @param	ByteCount contains the number of bytes in the buffer to be read.
*
* @return	XST_SUCCESS if successful else XST_FAILURE.
*
* @note		None
*
******************************************************************************/
This function reads a buffer of bytes  when the IIC Master on the bus writes
data to the slave device.
This function reads a buffer of bytes when the IIC Master on the bus writes data to the slave device .
int TenBitAddrReadData(u8 *BufferPtr, u16 ByteCount)
{
	int Status;
	ReceiveComplete = 1;
	Status = XIic_Start(&IicInstance);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	XIic_IntrGlobalEnable(IicInstance.BaseAddress);
	while ((ReceiveComplete) || (XIic_IsIicBusy(&IicInstance) == TRUE)) {
		if (SlaveRead) {
			XIic_SlaveRecv(&IicInstance, ReadBuffer, RECEIVE_COUNT);
			SlaveRead = 0;
		}
	}
	XIic_IntrGlobalDisable(IicInstance.BaseAddress);
	Status = XIic_Stop(&IicInstance);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
int TenBitAddrReadData ( u8 * BufferPtr , u16 ByteCount ) { int Status ; ReceiveComplete = 1 ; Status = XIic_Start ( & IicInstance ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } XIic_IntrGlobalEnable ( IicInstance . BaseAddress ) ; while ( ( ReceiveComplete ) || ( XIic_IsIicBusy ( & IicInstance ) == TRUE ) ) { if ( SlaveRead ) { XIic_SlaveRecv ( & IicInstance , ReadBuffer , RECEIVE_COUNT ) ; SlaveRead = 0 ; } } XIic_IntrGlobalDisable ( IicInstance . BaseAddress ) ; Status = XIic_Stop ( & IicInstance ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } return XST_SUCCESS ; }
This function reads a buffer of bytes  when the IIC Master on the bus writes
data to the slave device.
This function reads a buffer of bytes when the IIC Master on the bus writes data to the slave device .
/*
	 * Set the defaults.
	 */ /*
	 * Start the IIC device.
	 */ /*
	 * Set the Global Interrupt Enable.
	 */ /*
	 * Wait for AAS interrupt and completion of data reception.
	 */ /*
	 * Disable the Global Interrupt Enable.
	 */ /*
	 * Stop the IIC device.
	 */