lib/sw_apps/imgsel/src/xis_i2c.c
static int XIs_EepromWriteData(XIicPs *IicInstance, u16 ByteCount)
{
	int Status = XST_FAILURE;
	u32 Timeout = XIICPS_POLL_DEFAULT_TIMEOUT_VAL;

	/*
	 * Send the Data.
	 */
	Status = XIicPs_MasterSendPolled(IicInstance, WriteBuffer,
			ByteCount, XIS_EEPROM_ADDRESS);
	if (Status != XST_SUCCESS) {
		Status = XIS_IICPS_MASTER_SEND_POLLED_ERROR;
		goto END;
	}

	/*
	 * Wait until bus is idle to start another transfer.
	 */
	while (Timeout != 0U) {
		if(XIicPs_BusIsBusy(IicInstance) == FALSE ) {
			break;
		}
		XIs_Delay(XIS_DELAY);
		Timeout--;
		if(!Timeout) {
			Status = XIS_IICPS_TIMEOUT;
			goto END;
		}
	}

END:
	return Status;
}
/*****************************************************************************/
/**
 * This function writes a buffer of data to the IIC serial EEPROM.
 *
 * @param	IicInstance Pointer to IIC instance
 * @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.
@param       IicInstance Pointer to IIC instance
@param       ByteCount contains the number of bytes in the buffer to be
written.



@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 . @param IicInstance Pointer to IIC instance @param ByteCount contains the number of bytes in the buffer to be written . @note The Byte count should not exceed the page size of the EEPROM as noted by the constant PAGE_SIZE .
static int XIs_EepromWriteData(XIicPs *IicInstance, u16 ByteCount)
{
	int Status = XST_FAILURE;
	u32 Timeout = XIICPS_POLL_DEFAULT_TIMEOUT_VAL;
	Status = XIicPs_MasterSendPolled(IicInstance, WriteBuffer,
			ByteCount, XIS_EEPROM_ADDRESS);
	if (Status != XST_SUCCESS) {
		Status = XIS_IICPS_MASTER_SEND_POLLED_ERROR;
		goto END;
	}
	while (Timeout != 0U) {
		if(XIicPs_BusIsBusy(IicInstance) == FALSE ) {
			break;
		}
		XIs_Delay(XIS_DELAY);
		Timeout--;
		if(!Timeout) {
			Status = XIS_IICPS_TIMEOUT;
			goto END;
		}
	}
END:
	return Status;
}
static int XIs_EepromWriteData ( XIicPs * IicInstance , u16 ByteCount ) { int Status = XST_FAILURE ; u32 Timeout = XIICPS_POLL_DEFAULT_TIMEOUT_VAL ; Status = XIicPs_MasterSendPolled ( IicInstance , WriteBuffer , ByteCount , XIS_EEPROM_ADDRESS ) ; if ( Status != XST_SUCCESS ) { Status = XIS_IICPS_MASTER_SEND_POLLED_ERROR ; goto END ; } while ( Timeout != 0U ) { if ( XIicPs_BusIsBusy ( IicInstance ) == FALSE ) { break ; } XIs_Delay ( XIS_DELAY ) ; Timeout -- ; if ( ! Timeout ) { Status = XIS_IICPS_TIMEOUT ; goto END ; } } END : return Status ; }
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 until bus is idle to start another transfer.
	 */