XilinxProcessorIPLib/drivers/iicps/examples/xiicps_eeprom_intr_example.c
static int EepromWriteData(XIicPs *IicInstance, u16 ByteCount)
{

	TransmitComplete = FALSE;

	/*
	 * Send the Data.
	 */
	XIicPs_MasterSend(IicInstance, WriteBuffer,
			   ByteCount, EepromSlvAddr);

	/*
	 * Wait for the entire buffer to be sent, letting the interrupt
	 * processing work in the background, this function may get
	 * locked up in this loop if the interrupts are not working
	 * correctly.
	 */
	while (TransmitComplete == FALSE) {
		if (0 != TotalErrorCount) {
			return XST_FAILURE;
		}
	}

	/*
	 * Wait until bus is idle to start another transfer.
	 */
	while (XIicPs_BusIsBusy(IicInstance));

	/*
	 * Wait for a bit of time to allow the programming to complete
	 */
	usleep(250000);

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
* This function writes a buffer of data to the IIC serial EEPROM.
*
* @param	ByteCount contains the number of bytes in the buffer to be
*		written.
*
* @return	XST_SUCCESS if successful else XST_FAILURE.
*
* @note		The Byte count should not exceed the page size of the EEPROM as
*		noted by the constant PAGE_SIZE.
*
******************************************************************************/
This function writes a buffer of data to the IIC serial EEPROM.
This function writes a buffer of data to the IIC serial EEPROM .
static int EepromWriteData(XIicPs *IicInstance, u16 ByteCount)
{
	TransmitComplete = FALSE;
	XIicPs_MasterSend(IicInstance, WriteBuffer,
			   ByteCount, EepromSlvAddr);
	while (TransmitComplete == FALSE) {
		if (0 != TotalErrorCount) {
			return XST_FAILURE;
		}
	}
	while (XIicPs_BusIsBusy(IicInstance));
	usleep(250000);
	return XST_SUCCESS;
}
static int EepromWriteData ( XIicPs * IicInstance , u16 ByteCount ) { TransmitComplete = FALSE ; XIicPs_MasterSend ( IicInstance , WriteBuffer , ByteCount , EepromSlvAddr ) ; while ( TransmitComplete == FALSE ) { if ( 0 != TotalErrorCount ) { return XST_FAILURE ; } } while ( XIicPs_BusIsBusy ( IicInstance ) ) ; usleep ( 250000 ) ; return XST_SUCCESS ; }
This function writes a buffer of data to the IIC serial EEPROM.
This function writes a buffer of data to the IIC serial EEPROM .
/*
	 * Send the Data.
	 */ /*
	 * Wait for the entire buffer to be sent, letting the interrupt
	 * processing work in the background, this function may get
	 * locked up in this loop if the interrupts are not working
	 * correctly.
	 */ /*
	 * Wait until bus is idle to start another transfer.
	 */ /*
	 * Wait for a bit of time to allow the programming to complete
	 */