lib/sw_services/xilisf/examples/xilisf_spips_sst_polled_example.c
int FlashErase(XIsf *InstancePtr, u32 Address, u32 ByteCount)
{
	int Status = XST_FAILURE;
	int Sector;

	/*
	 * If the erase size is less than the total size of the flash, use
	 * sector erase command
	 */
	for (Sector = 0; Sector < ((ByteCount / SECTOR_SIZE) + 1); Sector++) {

		/*
		 * Write enable instruction has to be executed prior to
		 * any Write operation.
		 */
		WriteEnable(InstancePtr);

		/*
		 * Perform the Sector Erase operation.
		 */
		Status = XIsf_Erase(InstancePtr, XISF_SECTOR_ERASE, Address);
		if(Status != XST_SUCCESS) {
			return XST_FAILURE;
		}

		/*
		 * Wait till the Flash is not Busy.
		 */
		Status = IsfWaitForFlashNotBusy();
		if(Status != XST_SUCCESS) {
			return XST_FAILURE;
		}

		Address += SECTOR_SIZE;
	}

	return XST_SUCCESS;
}
/******************************************************************************
*
*
* This function erases the sectors in the  serial FLASH connected to the
* SPI interface.
*
* @param	InstancePtr is a pointer to the XIsf component to use.
* @param	Address contains the address of the first sector which needs to
*		be erased.
* @param	ByteCount contains the total size to be erased.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function erases the sectors in the  serial FLASH connected to the
SPI interface.
This function erases the sectors in the serial FLASH connected to the SPI interface .
int FlashErase(XIsf *InstancePtr, u32 Address, u32 ByteCount)
{
	int Status = XST_FAILURE;
	int Sector;
	for (Sector = 0; Sector < ((ByteCount / SECTOR_SIZE) + 1); Sector++) {
		WriteEnable(InstancePtr);
		Status = XIsf_Erase(InstancePtr, XISF_SECTOR_ERASE, Address);
		if(Status != XST_SUCCESS) {
			return XST_FAILURE;
		}
		Status = IsfWaitForFlashNotBusy();
		if(Status != XST_SUCCESS) {
			return XST_FAILURE;
		}
		Address += SECTOR_SIZE;
	}
	return XST_SUCCESS;
}
int FlashErase ( XIsf * InstancePtr , u32 Address , u32 ByteCount ) { int Status = XST_FAILURE ; int Sector ; for ( Sector = 0 ; Sector < ( ( ByteCount / SECTOR_SIZE ) + 1 ) ; Sector ++ ) { WriteEnable ( InstancePtr ) ; Status = XIsf_Erase ( InstancePtr , XISF_SECTOR_ERASE , Address ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = IsfWaitForFlashNotBusy ( ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Address += SECTOR_SIZE ; } return XST_SUCCESS ; }
This function erases the sectors in the  serial FLASH connected to the
SPI interface.
This function erases the sectors in the serial FLASH connected to the SPI interface .
/*
	 * If the erase size is less than the total size of the flash, use
	 * sector erase command
	 */ /*
		 * Write enable instruction has to be executed prior to
		 * any Write operation.
		 */ /*
		 * Perform the Sector Erase operation.
		 */ /*
		 * Wait till the Flash is not Busy.
		 */