XilinxProcessorIPLib/drivers/spi/examples/xspi_intel_flash_example.c
int SpiIntelFlashWriteEnable(XSpi *SpiPtr)
{
	int Status;

	/*
	 * Prepare the WriteBuffer.
	 */
	WriteBuffer[BYTE1] = INTEL_COMMAND_WRITE_ENABLE;

	/*
	 * Initiate the Transfer.
	 */
	TransferInProgress = TRUE;
	Status = XSpi_Transfer(SpiPtr, WriteBuffer, NULL,
				INTEL_WRITE_ENABLE_BYTES);
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Wait till the Transfer is complete and check if there are any errors
	 * in the transaction..
	 */
	while(TransferInProgress);
	if(ErrorCount != 0) {
		ErrorCount = 0;
		return XST_FAILURE;
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function enables writes to the Intel Serial Flash memory.
*
* @param	SpiPtr is a pointer to the instance of the Spi device.
*
* @return	XST_SUCCESS if successful else XST_FAILURE.
*
* @note		None.
*
******************************************************************************/
This function enables writes to the Intel Serial Flash memory.
This function enables writes to the Intel Serial Flash memory .
int SpiIntelFlashWriteEnable(XSpi *SpiPtr)
{
	int Status;
	WriteBuffer[BYTE1] = INTEL_COMMAND_WRITE_ENABLE;
	TransferInProgress = TRUE;
	Status = XSpi_Transfer(SpiPtr, WriteBuffer, NULL,
				INTEL_WRITE_ENABLE_BYTES);
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	while(TransferInProgress);
	if(ErrorCount != 0) {
		ErrorCount = 0;
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
int SpiIntelFlashWriteEnable ( XSpi * SpiPtr ) { int Status ; WriteBuffer [ BYTE1 ] = INTEL_COMMAND_WRITE_ENABLE ; TransferInProgress = TRUE ; Status = XSpi_Transfer ( SpiPtr , WriteBuffer , NULL , INTEL_WRITE_ENABLE_BYTES ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } while ( TransferInProgress ) ; if ( ErrorCount != 0 ) { ErrorCount = 0 ; return XST_FAILURE ; } return XST_SUCCESS ; }
This function enables writes to the Intel Serial Flash memory.
This function enables writes to the Intel Serial Flash memory .
/*
	 * Prepare the WriteBuffer.
	 */ /*
	 * Initiate the Transfer.
	 */ /*
	 * Wait till the Transfer is complete and check if there are any errors
	 * in the transaction..
	 */