qspipsu
Vitis Drivers API Documentation
xqspipsu_generic_flash_interrupt_example.c File Reference

Overview

This file contains a design example using the QSPIPSU driver (XQspiPsu) with a serial Flash device greater than or equal to 128Mb.

The example writes to flash and reads it back in DMA mode. This examples runs with GENFIFO Manual start. It runs in interrupt mode. This example illustrates single, parallel and stacked modes. Both the flash devices have to be of the same make and size. The hardware which this example runs on, must have a serial Flash (Micron N25Q or Spansion S25FL) for it to run. In order to test in single, parallel or stacked flash configurations the necessary HW must be present and QSPI_MODE (also reflected in ConnectionMode in the instance) has to be in sync with HW flash configuration being tested.

This example has been tested with the Micron Serial Flash (N25Q512) and ISSI Serial Flash parts of IS25WP and IS25LP series flashes in single and parallel modes using A53 and R5 processors.

Note

None.

 MODIFICATION HISTORY:
 Ver   Who Date     Changes


1.0 hk 08/21/14 First release sk 06/17/15 Used Tx/Rx flags for Transmitting/Receiving. sk 11/23/15 Added Support for Macronix 1Gb part. ms 04/05/17 Modified Comment lines in functions to recognize it as documentation block for doxygen generation. 1.1 tjs 06/16/17 Added support for IS25LP256D flash part (PR-4650) 1.5 tjs 09/15/17 Replaced #ifdef COMMENTS to #if USE_FOUR_BYTE (CR-984966) 1.6 tjs 10/16/17 #ifdef COMMENT replaced with the flow similar to u-boot and linux for accessing flash parts with size more then 16MB (CR-984966) 1.7 tjs 11/16/17 Removed the unsupported 4 Byte write and sector erase commands. 1.7 tjs 12/01/17 Added support for MT25QL02G Flash from Micron. CR-990642 1.7 tjs 12/19/17 Added support for S25FL064L from Spansion. CR-990724 1.7 tjs 01/11/18 Added support for MX66L1G45G flash from Macronix CR-992367 1.7 tjs 26/03/18 In dual parallel mode enable both CS when issuing Write enable command. CR-998478 1.8 tjs 05/02/18 Added support for IS25LP064 and IS25WP064. 1.8 tjs 16/07/18 Added support for the low density ISSI flash parts. 1.9 akm 02/27/19 Added support for IS25LP128, IS25WP128, IS25LP256, IS25WP256, IS25LP512, IS25WP512 Flash Devices 1.9 akm 04/03/19 Fixed data alignment warnings on IAR compiler. 1.10 akm 09/05/19 Added Multi Die Erase and Muti Die Read support. 1.13 akm 11/30/20 Removed unwanted header files. 1.13 akm 12/10/20 Set Read command as per the qspi bus width. 1.14 akm 07/16/21 Enable Quad Mode for Winbond flashes. 1.15 akm 11/19/21 Fix read/write failures on Spansion flash parts. 1.15 akm 12/22/21 Initialize variables before use. 1.16 akm 08/16/22 Fix logical error in NumSect calculation. 1.17 akm 12/16/22 Add timeout in QSPIPSU driver examples. 1.18 sb 05/19/23 Update number of sector calculation logic in flash erase API. 1.18 sb 06/07/23 Added support for system device-tree flow. 1.18 sb 07/24/23 Fix wrong init sequence for spansion byte ID. 1.18 sb 08/02/23 Add status check for XQspiPsu_SetClkPrescaler API.

 

Functions

int QspiPsuInterruptFlashExample (XScuGic *IntcInstancePtr, XQspiPsu *QspiPsuInstancePtr, u16 QspiPsuDeviceId, u16 QspiPsuIntrId)
 The purpose of this function is to illustrate how to use the XQspiPsu device driver in single, parallel and stacked modes using flash devices greater than or equal to 128Mb. More...
 
int FlashReadID (XQspiPsu *QspiPsuPtr)
 Reads the flash ID and identifies the flash in FCT table. More...
 
int FlashErase (XQspiPsu *QspiPsuPtr, u32 Address, u32 ByteCount, u8 *WriteBfrPtr)
 This function erases the sectors in the serial Flash connected to the QSPIPSU interface. More...
 
int FlashWrite (XQspiPsu *QspiPsuPtr, u32 Address, u32 ByteCount, u8 Command, u8 *WriteBfrPtr)
 This function writes to the serial Flash connected to the QSPIPSU interface. More...
 
int FlashRead (XQspiPsu *QspiPsuPtr, u32 Address, u32 ByteCount, u8 Command, u8 *WriteBfrPtr, u8 *ReadBfrPtr)
 This function performs a read. More...
 
int MultiDieRead (XQspiPsu *QspiPsuPtr, u32 Address, u32 ByteCount, u8 Command, u8 *WriteBfrPtr, u8 *ReadBfrPtr)
 This function performs a read operation for multi die flash devices. More...
 
u32 GetRealAddr (XQspiPsu *QspiPsuPtr, u32 Address)
 This functions translates the address based on the type of interconnection. More...
 
int BulkErase (XQspiPsu *QspiPsuPtr, u8 *WriteBfrPtr)
 This functions performs a bulk erase operation when the flash device has a single die. More...
 
int DieErase (XQspiPsu *QspiPsuPtr, u8 *WriteBfrPtr)
 This functions performs a die erase operation on all the die in the flash device. More...
 
void QspiPsuHandler (void *CallBackRef, u32 StatusEvent, unsigned int ByteCount)
 Callback handler. More...
 
int FlashEnterExit4BAddMode (XQspiPsu *QspiPsuPtr, unsigned int Enable)
 This API enters the flash device into 4 bytes addressing mode. More...
 
int FlashEnableQuadMode (XQspiPsu *QspiPsuPtr)
 This API enables Quad mode for the flash parts which require to enable quad mode before using Quad commands. More...
 
int main (void)
 Main function to call the QSPIPSU Flash example. More...
 

Function Documentation

int BulkErase ( XQspiPsu QspiPsuPtr,
u8 *  WriteBfrPtr 
)

This functions performs a bulk erase operation when the flash device has a single die.

Works for both Spansion and Micron

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
WriteBfrPtris the pointer to command+address to be sent
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

References XQspiPsu_Msg::BusWidth, XQspiPsu_Msg::ByteCount, XQspiPsu::Config, XQspiPsu_Config::ConnectionMode, XQspiPsu_Msg::Flags, MAX_DELAY_CNT, XQspiPsu_Msg::RxBfrPtr, XQspiPsu_Msg::TxBfrPtr, XQSPIPSU_CONNECTION_MODE_PARALLEL, XQspiPsu_InterruptTransfer(), XQSPIPSU_MSG_FLAG_RX, XQSPIPSU_MSG_FLAG_STRIPE, XQSPIPSU_MSG_FLAG_TX, and XQSPIPSU_SELECT_MODE_SPI.

Referenced by FlashErase().

int DieErase ( XQspiPsu QspiPsuPtr,
u8 *  WriteBfrPtr 
)

This functions performs a die erase operation on all the die in the flash device.

This function uses the die erase command for Micron 512Mbit and 1Gbit

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
WriteBfrPtris the pointer to command+address to be sent
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

References XQspiPsu_Msg::BusWidth, XQspiPsu_Msg::ByteCount, XQspiPsu::Config, XQspiPsu_Config::ConnectionMode, XQspiPsu_Msg::Flags, GetRealAddr(), MAX_DELAY_CNT, XQspiPsu_Msg::RxBfrPtr, XQspiPsu_Msg::TxBfrPtr, XQSPIPSU_CONNECTION_MODE_PARALLEL, XQSPIPSU_CONNECTION_MODE_STACKED, XQspiPsu_InterruptTransfer(), XQSPIPSU_MSG_FLAG_RX, XQSPIPSU_MSG_FLAG_STRIPE, XQSPIPSU_MSG_FLAG_TX, and XQSPIPSU_SELECT_MODE_SPI.

Referenced by FlashErase().

int FlashEnableQuadMode ( XQspiPsu QspiPsuPtr)

This API enables Quad mode for the flash parts which require to enable quad mode before using Quad commands.

For S25FL-L series flash parts this is required as the default configuration is x1/x2 mode.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if it fails.

References XQspiPsu_Msg::BusWidth, XQspiPsu_Msg::ByteCount, XQspiPsu::Config, XQspiPsu_Config::ConnectionMode, XQspiPsu_Msg::Flags, GetRealAddr(), ISSI_ID_BYTE0, MAX_DELAY_CNT, XQspiPsu_Msg::RxBfrPtr, XQspiPsu_Msg::TxBfrPtr, XQSPIPSU_CONNECTION_MODE_PARALLEL, XQspiPsu_InterruptTransfer(), XQSPIPSU_MSG_FLAG_RX, XQSPIPSU_MSG_FLAG_STRIPE, XQSPIPSU_MSG_FLAG_TX, and XQSPIPSU_SELECT_MODE_SPI.

Referenced by QspiPsuFlashNonBlockingReadExample(), QspiPsuInterruptFlashExample(), and QspiPsuPolledFlashExample().

int FlashEnterExit4BAddMode ( XQspiPsu QspiPsuPtr,
unsigned int  Enable 
)

This API enters the flash device into 4 bytes addressing mode.

As per the Micron and ISSI spec, before issuing the command to enter into 4 byte addr mode, a write enable command is issued. For Macronix and Winbond flash parts write enable is not required.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Enableis a either 1 or 0 if 1 then enters 4 byte if 0 exits.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if it fails.

References XQspiPsu_Msg::BusWidth, XQspiPsu_Msg::ByteCount, XQspiPsu::Config, XQspiPsu_Config::ConnectionMode, XQspiPsu_Msg::Flags, GetRealAddr(), ISSI_ID_BYTE0, MAX_DELAY_CNT, XQspiPsu_Msg::RxBfrPtr, XQspiPsu_Msg::TxBfrPtr, XQSPIPSU_CONNECTION_MODE_PARALLEL, XQspiPsu_InterruptTransfer(), XQSPIPSU_MSG_FLAG_RX, XQSPIPSU_MSG_FLAG_STRIPE, XQSPIPSU_MSG_FLAG_TX, and XQSPIPSU_SELECT_MODE_SPI.

Referenced by QspiPsuFlashNonBlockingReadExample(), QspiPsuInterruptFlashExample(), QspiPsuPolledFlashExample(), and QspiPsuWriteProtectFlashExample().

int FlashErase ( XQspiPsu QspiPsuPtr,
u32  Address,
u32  ByteCount,
u8 *  WriteBfrPtr 
)

This function erases the sectors in the serial Flash connected to the QSPIPSU interface.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address of the first sector which needs to be erased.
ByteCountcontains the total size to be erased.
WriteBfrPtris Pointer to the write buffer (which is to be transmitted)
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.
Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address of the first sector which needs to be erased.
ByteCountcontains the total size to be erased.
WriteBfrPtris pointer to the write buffer (which is to be transmitted)
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

References BulkErase(), XQspiPsu_Msg::BusWidth, XQspiPsu_Msg::ByteCount, XQspiPsu::Config, XQspiPsu_Config::ConnectionMode, DieErase(), XQspiPsu_Msg::Flags, GetRealAddr(), MAX_DELAY_CNT, XQspiPsu_Msg::RxBfrPtr, XQspiPsu_Msg::TxBfrPtr, XQSPIPSU_CONNECTION_MODE_PARALLEL, XQSPIPSU_CONNECTION_MODE_STACKED, XQspiPsu_InterruptTransfer(), XQSPIPSU_MSG_FLAG_RX, XQSPIPSU_MSG_FLAG_STRIPE, XQSPIPSU_MSG_FLAG_TX, XQSPIPSU_SELECT_FLASH_BUS_LOWER, XQSPIPSU_SELECT_FLASH_CS_LOWER, XQSPIPSU_SELECT_FLASH_CS_UPPER, XQSPIPSU_SELECT_MODE_SPI, and XQspiPsu_SelectFlash().

Referenced by QspiPsuFlashNonBlockingReadExample(), QspiPsuInterruptFlashExample(), QspiPsuPolledFlashExample(), and QspiPsuWriteProtectFlashExample().

int FlashRead ( XQspiPsu QspiPsuPtr,
u32  Address,
u32  ByteCount,
u8  Command,
u8 *  WriteBfrPtr,
u8 *  ReadBfrPtr 
)

This function performs a read.

This function performs read.

Default setting is in DMA mode.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address of the first sector which needs to be erased.
ByteCountcontains the total size to be erased.
Commandis the command used to read data from the flash. Supports normal, fast, dual and quad read commands.
WriteBfrPtrpointer to the write buffer which contains data to be transmitted
ReadBfrPtris pointer to the read buffer to which valid received data should be written
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

Default setting is in DMA mode.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address of the first sector which needs to be erased.
ByteCountcontains the total size to be erased.
Commandis the command used to read data from the flash. Supports normal, fast, dual and quad read commands.
WriteBfrPtris pointer to the write buffer which contains data to be transmitted
ReadBfrPtris pointer to the read buffer to which valid received data should be written
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

DMA is the default setting.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address of the first sector which needs to be erased.
ByteCountcontains the total size to be erased.
Commandis the command used to read data from the flash. Supports normal, fast, dual and quad read commands.
WriteBfrPtris Pointer to the write buffer which contains data to be transmitted
ReadBfrPtris Pointer to the read buffer to which valid received data should be written
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

DMA is the default setting.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address of the first sector which needs to be erased.
ByteCountcontains the total size to be erased.
Commandis the command used to read data from the flash. Supports normal, fast, dual and quad read commands.
WriteBfrPtris pointer to the write buffer which contains data to be transmitted
ReadBfrPtris pointer to the read buffer to which valid received data should be written
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

DMA is the default setting.

Parameters
QspiPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address of the first sector which needs to be erased.
ByteCountcontains the total size to be erased.
Commandis the command used to read data from the flash. Supports normal, fast, dual and quad read commands.
Pointerto the write buffer which contains data to be transmitted
Pointerto the read buffer to which valid received data should be written
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

References XQspiPsu_Msg::BusWidth, XQspiPsu_Msg::ByteCount, XQspiPsu::Config, XQspiPsu_Config::ConnectionMode, XQspiPsu_Msg::Flags, GetRealAddr(), MAX_DELAY_CNT, MultiDieRead(), XQspiPsu_Msg::RxBfrPtr, XQspiPsu_Msg::TxBfrPtr, XQSPIPSU_CONNECTION_MODE_PARALLEL, XQspiPsu_InterruptTransfer(), XQSPIPSU_MSG_FLAG_RX, XQSPIPSU_MSG_FLAG_STRIPE, XQSPIPSU_MSG_FLAG_TX, XQSPIPSU_SELECT_MODE_DUALSPI, XQSPIPSU_SELECT_MODE_QUADSPI, and XQSPIPSU_SELECT_MODE_SPI.

Referenced by QspiPsuFlashNonBlockingReadExample(), QspiPsuInterruptFlashExample(), QspiPsuPolledFlashExample(), and QspiPsuWriteProtectFlashExample().

int FlashReadID ( XQspiPsu QspiPsuPtr)

Reads the flash ID and identifies the flash in FCT table.

Reads the flash ID information.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.
Parameters
QspiPsuPtris a pointer to the instance of the QspiPsu device.
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.
Parameters
None.
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

References XQspiPsu_Msg::BusWidth, XQspiPsu_Msg::ByteCount, XQspiPsu_Msg::Flags, MAX_DELAY_CNT, XQspiPsu_Msg::RxBfrPtr, XQspiPsu_Msg::TxBfrPtr, XQspiPsu_InterruptTransfer(), XQSPIPSU_MSG_FLAG_RX, XQSPIPSU_MSG_FLAG_TX, and XQSPIPSU_SELECT_MODE_SPI.

Referenced by QspiPsuFlashNonBlockingReadExample(), QspiPsuInterruptFlashExample(), QspiPsuPolledFlashExample(), and QspiPsuWriteProtectFlashExample().

int FlashWrite ( XQspiPsu QspiPsuPtr,
u32  Address,
u32  ByteCount,
u8  Command,
u8 *  WriteBfrPtr 
)

This function writes to the serial Flash connected to the QSPIPSU interface.

All the data put into the buffer must be in the same page of the device with page boundaries being on 256 byte boundaries.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address to write data to in the Flash.
ByteCountcontains the number of bytes to write.
Commandis the command used to write data to the flash. QSPIPSU device supports only Page Program command to write data to the flash.
WriteBfrPtris pointer to the write buffer (which is to be transmitted)
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

All the data put into the buffer must be in the same page of the device with page boundaries being on 256 byte boundaries.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address to write data to in the Flash.
ByteCountcontains the number of bytes to write.
Commandis the command used to write data to the flash. QSPIPSU device supports only Page Program command to write data to the flash.
WriteBfrPtris Pointer to the write buffer (which is to be transmitted)
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.
Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address to write data to in the Flash.
ByteCountcontains the number of bytes to write.
Commandis the command used to write data to the flash.
Pointerto the write buffer (which is to be transmitted)
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

References XQspiPsu_Msg::BusWidth, XQspiPsu_Msg::ByteCount, XQspiPsu::Config, XQspiPsu_Config::ConnectionMode, XQspiPsu_Msg::Flags, GetRealAddr(), MAX_DELAY_CNT, XQspiPsu_Msg::RxBfrPtr, XQspiPsu_Msg::TxBfrPtr, XQSPIPSU_CONNECTION_MODE_PARALLEL, XQspiPsu_InterruptTransfer(), XQSPIPSU_MSG_FLAG_RX, XQSPIPSU_MSG_FLAG_STRIPE, XQSPIPSU_MSG_FLAG_TX, and XQSPIPSU_SELECT_MODE_SPI.

Referenced by QspiPsuFlashNonBlockingReadExample(), QspiPsuInterruptFlashExample(), QspiPsuPolledFlashExample(), and QspiPsuWriteProtectFlashExample().

u32 GetRealAddr ( XQspiPsu QspiPsuPtr,
u32  Address 
)

This functions translates the address based on the type of interconnection.

In case of stacked, this function asserts the corresponding slave select.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresswhich is to be accessed (for erase, write or read)
Returns
RealAddr is the translated address - for single it is unchanged; for stacked, the lower flash size is subtracted; for parallel the address is divided by 2.
Note
In addition to get the actual address to work on flash this function also selects the CS and BUS based on the configuration detected.

In case of stacked, this function asserts the corresponding slave select.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresswhich is to be accessed (for erase, write or read)
Returns
RealAddr is the translated address - for single it is unchanged for stacked, the lower flash size is subtracted; for parallel the address is divided by 2.
Note
In addition to get the actual address to work on flash this function also selects the CS and BUS based on the configuration detected.

References XQspiPsu::Config, XQspiPsu_Config::ConnectionMode, XQSPIPSU_CONNECTION_MODE_PARALLEL, XQSPIPSU_CONNECTION_MODE_SINGLE, XQSPIPSU_CONNECTION_MODE_STACKED, XQSPIPSU_SELECT_FLASH_BUS_BOTH, XQSPIPSU_SELECT_FLASH_BUS_LOWER, XQSPIPSU_SELECT_FLASH_CS_BOTH, XQSPIPSU_SELECT_FLASH_CS_LOWER, XQSPIPSU_SELECT_FLASH_CS_UPPER, and XQspiPsu_SelectFlash().

Referenced by DieErase(), FlashEnableQuadMode(), FlashEnterExit4BAddMode(), FlashErase(), FlashRead(), FlashWrite(), and MultiDieRead().

int main ( void  )

Main function to call the QSPIPSU Flash example.

Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note
None

References QspiPsuInterruptFlashExample().

int MultiDieRead ( XQspiPsu QspiPsuPtr,
u32  Address,
u32  ByteCount,
u8  Command,
u8 *  WriteBfrPtr,
u8 *  ReadBfrPtr 
)

This function performs a read operation for multi die flash devices.

This functions performs a read operation for multi die flash devices.

Default setting is in DMA mode.

Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address of the first sector which needs to be erased.
ByteCountcontains the total size to be erased.
Commandis the command used to read data from the flash. Supports normal, fast, dual and quad read commands.
WriteBfrPtris pointer to the write buffer which contains data to be transmitted
ReadBfrPtris pointer to the read buffer to which valid received data should be written
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.
Parameters
QspiPsuPtris a pointer to the QSPIPSU driver component to use.
Addresscontains the address of the first sector which needs to be erased.
ByteCountcontains the total size to be erased.
Commandis the command used to read data from the flash. Supports normal, fast, dual and quad read commands.
WriteBfrPtris pointer to the write buffer which contains data to be transmitted
ReadBfrPtris pointer to the read buffer to which valid received data should be written.
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

References XQspiPsu_Msg::BusWidth, XQspiPsu_Msg::ByteCount, XQspiPsu::Config, XQspiPsu_Config::ConnectionMode, XQspiPsu_Msg::Flags, GetRealAddr(), MAX_DELAY_CNT, XQspiPsu_Msg::RxBfrPtr, XQspiPsu_Msg::TxBfrPtr, XQSPIPSU_CONNECTION_MODE_PARALLEL, XQSPIPSU_CONNECTION_MODE_SINGLE, XQspiPsu_InterruptTransfer(), XQSPIPSU_MSG_FLAG_RX, XQSPIPSU_MSG_FLAG_STRIPE, XQSPIPSU_MSG_FLAG_TX, XQSPIPSU_SELECT_MODE_DUALSPI, XQSPIPSU_SELECT_MODE_QUADSPI, and XQSPIPSU_SELECT_MODE_SPI.

Referenced by FlashRead().

void QspiPsuHandler ( void *  CallBackRef,
u32  StatusEvent,
unsigned int  ByteCount 
)

Callback handler.

Parameters
CallBackRefis the upper layer callback reference passed back when the callback function is invoked.
StatusEventis the event that just occurred.
ByteCountis the number of bytes transferred up until the event occurred.
Returns
None
Note
None.
Parameters
CallBackRefis the upper layer callback reference passed back when the callback function is invoked.
StatusEventis the event that just occurred.
ByteCountis the number of bytes transferred up until the event occurred.
Note
None.
Parameters
None.
Returns
None
Note
None.

Referenced by QspiPsuInterruptFlashExample(), and QspiPsuWriteProtectFlashExample().

int QspiPsuInterruptFlashExample ( XScuGic *  IntcInstancePtr,
XQspiPsu QspiPsuInstancePtr,
u16  QspiPsuDeviceId,
u16  QspiPsuIntrId 
)

The purpose of this function is to illustrate how to use the XQspiPsu device driver in single, parallel and stacked modes using flash devices greater than or equal to 128Mb.

The purpose of this function is to illustrate how to use the XQspiPsu device driver using NAND flash devices.

Parameters
IntcInstancePtris a pointer to the instance of the Intc device.
QspiPsuInstancePtris a pointer to the instance of the QspiPsu device.
QspiPsuDeviceIdis the Device ID of the Qspi Device and is the XPAR_<QSPI_instance>_DEVICE_ID value from xparameters.h.
QspiPsuIntrIdis the interrupt Id for an QSPIPSU device.
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.
Parameters
None.
Returns
XST_SUCCESS if successful, else XST_FAILURE.
Note
None.

References XQspiPsu_Config::BaseAddress, XQspiPsu_Config::BusWidth, XQspiPsu::Config, XQspiPsu_Config::ConnectionMode, FlashEnableQuadMode(), FlashEnterExit4BAddMode(), FlashErase(), FlashRead(), FlashReadID(), FlashWrite(), QspiPsuHandler(), XQspiPsu_CfgInitialize(), XQSPIPSU_CLK_PRESCALE_8, XQSPIPSU_CONNECTION_MODE_PARALLEL, XQspiPsu_InterruptHandler(), XQspiPsu_LookupConfig(), XQSPIPSU_MANUAL_START_OPTION, XQSPIPSU_SELECT_FLASH_BUS_LOWER, XQSPIPSU_SELECT_FLASH_CS_LOWER, XQspiPsu_SelectFlash(), XQspiPsu_SetClkPrescaler(), XQspiPsu_SetOptions(), and XQspiPsu_SetStatusHandler().

Referenced by main().