lib/sw_services/xilisf/examples/xilisf_winbond_quad_flash_example.c
static int SpiFlashQuadEnable(void)
{
	int Status = XST_FAILURE;

	/*
	 * Perform the Write Enable operation.
	 */
	TransferInProgress = TRUE;
	Status = XIsf_WriteEnable(&Isf, XISF_WRITE_ENABLE);
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

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

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

	/*
	 * Prepare the WriteBuffer.
	 */
	WriteBuffer[BYTE1] = 0x00;
	WriteBuffer[BYTE2] = 0x02; /* QE = 1 */

	/*
	 * Perform the Write operation.
	 */
	TransferInProgress = TRUE;
	Status = XIsf_Write(&Isf, XISF_WRITE_STATUS_REG2, (void*) WriteBuffer);
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

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

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

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function sets the QuadEnable bit in Winbond flash.
*
* @param	None
*
* @return	XST_SUCCESS if successful else XST_FAILURE.
*
* @note		None.
*
******************************************************************************/
This function sets the QuadEnable bit in Winbond flash.
This function sets the QuadEnable bit in Winbond flash .
static int SpiFlashQuadEnable(void)
{
	int Status = XST_FAILURE;
	TransferInProgress = TRUE;
	Status = XIsf_WriteEnable(&Isf, XISF_WRITE_ENABLE);
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	while(TransferInProgress);
	if(ErrorCount != 0) {
		return XST_FAILURE;
	}
	Status = IsfWaitForFlashNotBusy();
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	WriteBuffer[BYTE1] = 0x00;
	WriteBuffer[BYTE2] = 0x02; 
	TransferInProgress = TRUE;
	Status = XIsf_Write(&Isf, XISF_WRITE_STATUS_REG2, (void*) WriteBuffer);
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	while(TransferInProgress);
	if(ErrorCount != 0) {
		return XST_FAILURE;
	}
	Status = IsfWaitForFlashNotBusy();
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
static int SpiFlashQuadEnable ( void ) { int Status = XST_FAILURE ; TransferInProgress = TRUE ; Status = XIsf_WriteEnable ( & Isf , XISF_WRITE_ENABLE ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } while ( TransferInProgress ) ; if ( ErrorCount != 0 ) { return XST_FAILURE ; } Status = IsfWaitForFlashNotBusy ( ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } WriteBuffer [ BYTE1 ] = 0x00 ; WriteBuffer [ BYTE2 ] = 0x02 ; TransferInProgress = TRUE ; Status = XIsf_Write ( & Isf , XISF_WRITE_STATUS_REG2 , ( void * ) WriteBuffer ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } while ( TransferInProgress ) ; if ( ErrorCount != 0 ) { return XST_FAILURE ; } Status = IsfWaitForFlashNotBusy ( ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } return XST_SUCCESS ; }
This function sets the QuadEnable bit in Winbond flash.
This function sets the QuadEnable bit in Winbond flash .
/*
	 * Perform the Write Enable operation.
	 */ /*
	 * Wait till the Transfer is complete and check for errors.
	 */ /*
	 * Wait till the Flash is not Busy.
	 */ /*
	 * Prepare the WriteBuffer.
	 */ /* QE = 1 */ /*
	 * Perform the Write operation.
	 */ /*
	 * Wait till the Transfer is complete and check for errors.
	 */ /*
	 * Wait till the Flash is not Busy.
	 */