Kinetis SDK v.2.0 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
QSPI: Quad Serial Peripheral Interface Driver

Overview

The KSDK provides a peripheral driver for the Quad Serial Peripheral Interface (QSPI) module of Kinetis devices.

Overview

QSPI driver includes functional APIs and EDMA transactional APIs.

Functional APIs are feature/property target low level APIs. Functional APIs can be used for QSPI initialization/configuration/operation for optimization/customization purpose. Using the functional API requires the knowledge of the QSPI peripheral and how to organize functional APIs to meet the application requirements. All functional API use the peripheral base address as the first parameter. QSPI functional operation groups provide the functional API set.

Transactional APIs are transaction target high level APIs. Transactional APIs can be used to enable the peripheral and in the application if the code size and performance of transactional APIs satisfy the requirements. If the code size and performance are a critical requirement, see the transactional API implementation and write a custom code. All transactional APIs use the qspi_handle_t as the first parameter. Initialize the handle by calling the QSPI_TransferTxCreateHandleEDMA() or QSPI_TransferRxCreateHandleEDMA() API.

Transactional APIs support asynchronous transfer. This means that the functions QSPI_TransferSendEDMA() and QSPI_TransferReceiveEDMA() set up EDMA for data transfer. When the transfer completes, the upper layer is notified through a callback function with the kStatus_QSPI_Idle status.

Modules

 QSPI eDMA Driver
 

Files

file  fsl_qspi.h
 

Data Structures

struct  qspi_dqs_config_t
 DQS configure features. More...
 
struct  qspi_flash_timing_t
 Flash timing configuration. More...
 
struct  qspi_config_t
 QSPI configuration structure. More...
 
struct  qspi_flash_config_t
 External flash configuration items. More...
 
struct  qspi_transfer_t
 Transfer structure for QSPI. More...
 

Enumerations

enum  _status_t {
  kStatus_QSPI_Idle = MAKE_STATUS(kStatusGroup_QSPI, 0),
  kStatus_QSPI_Busy = MAKE_STATUS(kStatusGroup_QSPI, 1),
  kStatus_QSPI_Error = MAKE_STATUS(kStatusGroup_QSPI, 2)
}
 Status structure of QSPI. More...
 
enum  qspi_read_area_t {
  kQSPI_ReadAHB = 0x0U,
  kQSPI_ReadIP
}
 QSPI read data area, from IP FIFO or AHB buffer. More...
 
enum  qspi_command_seq_t {
  kQSPI_IPSeq = QuadSPI_SPTRCLR_IPPTRC_MASK,
  kQSPI_BufferSeq = QuadSPI_SPTRCLR_BFPTRC_MASK
}
 QSPI command sequence type. More...
 
enum  qspi_fifo_t {
  kQSPI_TxFifo = QuadSPI_MCR_CLR_TXF_MASK,
  kQSPI_RxFifo = QuadSPI_MCR_CLR_RXF_MASK,
  kQSPI_AllFifo = QuadSPI_MCR_CLR_TXF_MASK | QuadSPI_MCR_CLR_RXF_MASK
}
 QSPI buffer type. More...
 
enum  qspi_endianness_t {
  kQSPI_64BigEndian = 0x0U,
  kQSPI_32LittleEndian,
  kQSPI_32BigEndian,
  kQSPI_64LittleEndian
}
 QSPI transfer endianess. More...
 
enum  _qspi_error_flags {
  kQSPI_DataLearningFail = QuadSPI_FR_DLPFF_MASK,
  kQSPI_TxBufferFill = QuadSPI_FR_TBFF_MASK,
  kQSPI_TxBufferUnderrun = QuadSPI_FR_TBUF_MASK,
  kQSPI_IllegalInstruction = QuadSPI_FR_ILLINE_MASK,
  kQSPI_RxBufferOverflow = QuadSPI_FR_RBOF_MASK,
  kQSPI_RxBufferDrain = QuadSPI_FR_RBDF_MASK,
  kQSPI_AHBSequenceError = QuadSPI_FR_ABSEF_MASK,
  kQSPI_AHBIllegalTransaction = QuadSPI_FR_AITEF_MASK,
  kQSPI_AHBIllegalBurstSize = QuadSPI_FR_AIBSEF_MASK,
  kQSPI_AHBBufferOverflow = QuadSPI_FR_ABOF_MASK,
  kQSPI_IPCommandUsageError = QuadSPI_FR_IUEF_MASK,
  kQSPI_IPCommandTriggerDuringAHBAccess = QuadSPI_FR_IPAEF_MASK,
  kQSPI_IPCommandTriggerDuringIPAccess = QuadSPI_FR_IPIEF_MASK,
  kQSPI_IPCommandTriggerDuringAHBGrant = QuadSPI_FR_IPGEF_MASK,
  kQSPI_IPCommandTransactionFinished = QuadSPI_FR_TFF_MASK,
  kQSPI_FlagAll = 0x8C83F8D1U
}
 QSPI error flags. More...
 
enum  _qspi_flags {
  kQSPI_DataLearningSamplePoint = QuadSPI_SR_DLPSMP_MASK,
  kQSPI_TxBufferFull = QuadSPI_SR_TXFULL_MASK,
  kQSPI_TxDMA = QuadSPI_SR_TXDMA_MASK,
  kQSPI_TxWatermark = QuadSPI_SR_TXWA_MASK,
  kQSPI_TxBufferEnoughData = QuadSPI_SR_TXEDA_MASK,
  kQSPI_RxDMA = QuadSPI_SR_RXDMA_MASK,
  kQSPI_RxBufferFull = QuadSPI_SR_RXFULL_MASK,
  kQSPI_RxWatermark = QuadSPI_SR_RXWE_MASK,
  kQSPI_AHB3BufferFull = QuadSPI_SR_AHB3FUL_MASK,
  kQSPI_AHB2BufferFull = QuadSPI_SR_AHB2FUL_MASK,
  kQSPI_AHB1BufferFull = QuadSPI_SR_AHB1FUL_MASK,
  kQSPI_AHB0BufferFull = QuadSPI_SR_AHB0FUL_MASK,
  kQSPI_AHB3BufferNotEmpty = QuadSPI_SR_AHB3NE_MASK,
  kQSPI_AHB2BufferNotEmpty = QuadSPI_SR_AHB2NE_MASK,
  kQSPI_AHB1BufferNotEmpty = QuadSPI_SR_AHB1NE_MASK,
  kQSPI_AHB0BufferNotEmpty = QuadSPI_SR_AHB0NE_MASK,
  kQSPI_AHBTransactionPending = QuadSPI_SR_AHBTRN_MASK,
  kQSPI_AHBCommandPriorityGranted = QuadSPI_SR_AHBGNT_MASK,
  kQSPI_AHBAccess = QuadSPI_SR_AHB_ACC_MASK,
  kQSPI_IPAccess = QuadSPI_SR_IP_ACC_MASK,
  kQSPI_Busy = QuadSPI_SR_BUSY_MASK,
  kQSPI_StateAll = 0xEF897FE7U
}
 QSPI state bit. More...
 
enum  _qspi_interrupt_enable {
  kQSPI_DataLearningFailInterruptEnable,
  kQSPI_TxBufferFillInterruptEnable = QuadSPI_RSER_TBFIE_MASK,
  kQSPI_TxBufferUnderrunInterruptEnable = QuadSPI_RSER_TBUIE_MASK,
  kQSPI_IllegalInstructionInterruptEnable,
  kQSPI_RxBufferOverflowInterruptEnable = QuadSPI_RSER_RBOIE_MASK,
  kQSPI_RxBufferDrainInterruptEnable = QuadSPI_RSER_RBDIE_MASK,
  kQSPI_AHBSequenceErrorInterruptEnable = QuadSPI_RSER_ABSEIE_MASK,
  kQSPI_AHBIllegalTransactionInterruptEnable,
  kQSPI_AHBIllegalBurstSizeInterruptEnable,
  kQSPI_AHBBufferOverflowInterruptEnable = QuadSPI_RSER_ABOIE_MASK,
  kQSPI_IPCommandUsageErrorInterruptEnable = QuadSPI_RSER_IUEIE_MASK,
  kQSPI_IPCommandTriggerDuringAHBAccessInterruptEnable,
  kQSPI_IPCommandTriggerDuringIPAccessInterruptEnable,
  kQSPI_IPCommandTriggerDuringAHBGrantInterruptEnable,
  kQSPI_IPCommandTransactionFinishedInterruptEnable,
  kQSPI_AllInterruptEnable = 0x8C83F8D1U
}
 QSPI interrupt enable. More...
 
enum  _qspi_dma_enable {
  kQSPI_TxBufferFillDMAEnable = QuadSPI_RSER_TBFDE_MASK,
  kQSPI_RxBufferDrainDMAEnable = QuadSPI_RSER_RBDDE_MASK,
  kQSPI_AllDDMAEnable = QuadSPI_RSER_TBFDE_MASK | QuadSPI_RSER_RBDDE_MASK
}
 QSPI DMA request flag. More...
 
enum  qspi_dqs_phrase_shift_t {
  kQSPI_DQSNoPhraseShift = 0x0U,
  kQSPI_DQSPhraseShift45Degree,
  kQSPI_DQSPhraseShift90Degree,
  kQSPI_DQSPhraseShift135Degree
}
 Phrase shift number for DQS mode. More...
 

Driver version

#define FSL_QSPI_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 I2C driver version 2.0.0. More...
 

Initialization and deinitialization

void QSPI_Init (QuadSPI_Type *base, qspi_config_t *config, uint32_t srcClock_Hz)
 Initializes the QSPI module and internal state. More...
 
void QSPI_GetDefaultQspiConfig (qspi_config_t *config)
 Gets default settings for QSPI. More...
 
void QSPI_Deinit (QuadSPI_Type *base)
 Deinitializes the QSPI module. More...
 
void QSPI_SetFlashConfig (QuadSPI_Type *base, qspi_flash_config_t *config)
 Configures the serial flash parameter. More...
 
void QSPI_SoftwareReset (QuadSPI_Type *base)
 Software reset for the QSPI logic. More...
 
static void QSPI_Enable (QuadSPI_Type *base, bool enable)
 Enables or disables the QSPI module. More...
 

Status

static uint32_t QSPI_GetStatusFlags (QuadSPI_Type *base)
 Gets the state value of QSPI. More...
 
static uint32_t QSPI_GetErrorStatusFlags (QuadSPI_Type *base)
 Gets QSPI error status flags. More...
 
static void QSPI_ClearErrorFlag (QuadSPI_Type *base, uint32_t mask)
 Clears the QSPI error flags. More...
 

Interrupts

static void QSPI_EnableInterrupts (QuadSPI_Type *base, uint32_t mask)
 Enables the QSPI interrupts. More...
 
static void QSPI_DisableInterrupts (QuadSPI_Type *base, uint32_t mask)
 Disables the QSPI interrupts. More...
 

DMA Control

static void QSPI_EnableDMA (QuadSPI_Type *base, uint32_t mask, bool enable)
 Enables the QSPI DMA source. More...
 
static uint32_t QSPI_GetTxDataRegisterAddress (QuadSPI_Type *base)
 Gets the Tx data register address. More...
 
uint32_t QSPI_GetRxDataRegisterAddress (QuadSPI_Type *base)
 Gets the Rx data register address used for DMA operation. More...
 

Bus Operations

static void QSPI_SetIPCommandAddress (QuadSPI_Type *base, uint32_t addr)
 Sets the IP command address. More...
 
static void QSPI_SetIPCommandSize (QuadSPI_Type *base, uint32_t size)
 Sets the IP command size. More...
 
void QSPI_ExecuteIPCommand (QuadSPI_Type *base, uint32_t index)
 Executes IP commands located in LUT table. More...
 
void QSPI_ExecuteAHBCommand (QuadSPI_Type *base, uint32_t index)
 Executes AHB commands located in LUT table. More...
 
static void QSPI_EnableIPParallelMode (QuadSPI_Type *base, bool enable)
 Enables/disables the QSPI IP command parallel mode. More...
 
static void QSPI_EnableAHBParallelMode (QuadSPI_Type *base, bool enable)
 Enables/disables the QSPI AHB command parallel mode. More...
 
void QSPI_UpdateLUT (QuadSPI_Type *base, uint32_t index, uint32_t *cmd)
 Updates the LUT table. More...
 
static void QSPI_ClearFifo (QuadSPI_Type *base, uint32_t mask)
 Clears the QSPI FIFO logic. More...
 
static void QSPI_ClearCommandSequence (QuadSPI_Type *base, qspi_command_seq_t seq)
 @ brief Clears the command sequence for the IP/buffer command. More...
 
void QSPI_WriteBlocking (QuadSPI_Type *base, uint32_t *buffer, size_t size)
 Sends a buffer of data bytes using a blocking method. More...
 
static void QSPI_WriteData (QuadSPI_Type *base, uint32_t data)
 Writes data into FIFO. More...
 
void QSPI_ReadBlocking (QuadSPI_Type *base, uint32_t *buffer, size_t size)
 Receives a buffer of data bytes using a blocking method. More...
 
uint32_t QSPI_ReadData (QuadSPI_Type *base)
 Receives data from data FIFO. More...
 

Transactional

static void QSPI_TransferSendBlocking (QuadSPI_Type *base, qspi_transfer_t *xfer)
 Writes data to the QSPI transmit buffer. More...
 
static void QSPI_TransferReceiveBlocking (QuadSPI_Type *base, qspi_transfer_t *xfer)
 Reads data from the QSPI receive buffer in polling way. More...
 

Data Structure Documentation

struct qspi_dqs_config_t

Data Fields

uint32_t portADelayTapNum
 Delay chain tap number selection for QSPI port A DQS.
 
uint32_t portBDelayTapNum
 Delay chain tap number selection for QSPI port B DQS.
 
qspi_dqs_phrase_shift_t shift
 Phase shift for internal DQS generation.
 
bool enableDQSClkInverse
 Enable inverse clock for internal DQS generation.
 
bool enableDQSPadLoopback
 Enable DQS loop back from DQS pad.
 
bool enableDQSLoopback
 Enable DQS loop back.
 
struct qspi_flash_timing_t

Data Fields

uint32_t dataHoldTime
 Serial flash data in hold time.
 
uint32_t CSHoldTime
 Serial flash CS hold time in terms of serial flash clock cycles.
 
uint32_t CSSetupTime
 Serial flash CS setup time in terms of serial flash clock cycles.
 
struct qspi_config_t

Data Fields

uint32_t clockSource
 Clock source for QSPI module.
 
uint32_t baudRate
 Serial flash clock baud rate.
 
uint8_t txWatermark
 QSPI transmit watermark value.
 
uint8_t rxWatermark
 QSPI receive watermark value. More...
 
uint32_t AHBbufferSize [FSL_FEATURE_QSPI_AHB_BUFFER_COUNT]
 AHB buffer size. More...
 
uint8_t AHBbufferMaster [FSL_FEATURE_QSPI_AHB_BUFFER_COUNT]
 AHB buffer master. More...
 
bool enableAHBbuffer3AllMaster
 Is AHB buffer3 for all master. More...
 
qspi_read_area_t area
 Which area Rx data readout.
 
bool enableQspi
 Enable QSPI after initialization.
 

Field Documentation

uint8_t qspi_config_t::rxWatermark
uint32_t qspi_config_t::AHBbufferSize[FSL_FEATURE_QSPI_AHB_BUFFER_COUNT]
uint8_t qspi_config_t::AHBbufferMaster[FSL_FEATURE_QSPI_AHB_BUFFER_COUNT]
bool qspi_config_t::enableAHBbuffer3AllMaster
struct qspi_flash_config_t

Data Fields

uint32_t flashA1Size
 Flash A1 size.
 
uint32_t flashA2Size
 Flash A2 size.
 
uint32_t flashB1Size
 Flash B1 size.
 
uint32_t flashB2Size
 Flash B2 size.
 
uint32_t lookuptable [FSL_FEATURE_QSPI_LUT_DEPTH]
 Flash command in LUT.
 
uint32_t dataHoldTime
 Data line hold time. More...
 
uint32_t CSHoldTime
 CS line hold time.
 
uint32_t CSSetupTime
 CS line setup time.
 
uint32_t cloumnspace
 Column space size.
 
uint32_t dataLearnValue
 Data Learn value if enable data learn.
 
qspi_endianness_t endian
 Flash data endianess. More...
 
bool enableWordAddress
 If enable word address. More...
 

Field Documentation

uint32_t qspi_flash_config_t::dataHoldTime
qspi_endianness_t qspi_flash_config_t::endian
bool qspi_flash_config_t::enableWordAddress
struct qspi_transfer_t

Data Fields

uint32_t * data
 Pointer to data to transmit.
 
size_t dataSize
 Bytes to be transmit.
 

Macro Definition Documentation

#define FSL_QSPI_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Enumeration Type Documentation

enum _status_t
Enumerator
kStatus_QSPI_Idle 

QSPI is in idle state.

kStatus_QSPI_Busy 

QSPI is busy.

kStatus_QSPI_Error 

Error occurred during QSPI transfer.

Enumerator
kQSPI_ReadAHB 

QSPI read from AHB buffer.

kQSPI_ReadIP 

QSPI read from IP FIFO.

Enumerator
kQSPI_IPSeq 

IP command sequence.

kQSPI_BufferSeq 

Buffer command sequence.

Enumerator
kQSPI_TxFifo 

QSPI Tx FIFO.

kQSPI_RxFifo 

QSPI Rx FIFO.

kQSPI_AllFifo 

QSPI all FIFO, including Tx and Rx.

Enumerator
kQSPI_64BigEndian 

64 bits big endian

kQSPI_32LittleEndian 

32 bit little endian

kQSPI_32BigEndian 

32 bit big endian

kQSPI_64LittleEndian 

64 bit little endian

Enumerator
kQSPI_DataLearningFail 

Data learning pattern failure flag.

kQSPI_TxBufferFill 

Tx buffer fill flag.

kQSPI_TxBufferUnderrun 

Tx buffer underrun flag.

kQSPI_IllegalInstruction 

Illegal instruction error flag.

kQSPI_RxBufferOverflow 

Rx buffer overflow flag.

kQSPI_RxBufferDrain 

Rx buffer drain flag.

kQSPI_AHBSequenceError 

AHB sequence error flag.

kQSPI_AHBIllegalTransaction 

AHB illegal transaction error flag.

kQSPI_AHBIllegalBurstSize 

AHB illegal burst error flag.

kQSPI_AHBBufferOverflow 

AHB buffer overflow flag.

kQSPI_IPCommandUsageError 

IP command usage error flag.

kQSPI_IPCommandTriggerDuringAHBAccess 

IP command trigger during AHB access error.

kQSPI_IPCommandTriggerDuringIPAccess 

IP command trigger cannot be executed.

kQSPI_IPCommandTriggerDuringAHBGrant 

IP command trigger during AHB grant error.

kQSPI_IPCommandTransactionFinished 

IP command transaction finished flag.

kQSPI_FlagAll 

All error flag.

Enumerator
kQSPI_DataLearningSamplePoint 

Data learning sample point.

kQSPI_TxBufferFull 

Tx buffer full flag.

kQSPI_TxDMA 

Tx DMA is requested or running.

kQSPI_TxWatermark 

Tx buffer watermark available.

kQSPI_TxBufferEnoughData 

Tx buffer enough data available.

kQSPI_RxDMA 

Rx DMA is requesting or running.

kQSPI_RxBufferFull 

Rx buffer full.

kQSPI_RxWatermark 

Rx buffer watermark exceeded.

kQSPI_AHB3BufferFull 

AHB buffer 3 full.

kQSPI_AHB2BufferFull 

AHB buffer 2 full.

kQSPI_AHB1BufferFull 

AHB buffer 1 full.

kQSPI_AHB0BufferFull 

AHB buffer 0 full.

kQSPI_AHB3BufferNotEmpty 

AHB buffer 3 not empty.

kQSPI_AHB2BufferNotEmpty 

AHB buffer 2 not empty.

kQSPI_AHB1BufferNotEmpty 

AHB buffer 1 not empty.

kQSPI_AHB0BufferNotEmpty 

AHB buffer 0 not empty.

kQSPI_AHBTransactionPending 

AHB access transaction pending.

kQSPI_AHBCommandPriorityGranted 

AHB command priority granted.

kQSPI_AHBAccess 

AHB access.

kQSPI_IPAccess 

IP access.

kQSPI_Busy 

Module busy.

kQSPI_StateAll 

All flags.

Enumerator
kQSPI_DataLearningFailInterruptEnable 

Data learning pattern failure interrupt enable.

kQSPI_TxBufferFillInterruptEnable 

Tx buffer fill interrupt enable.

kQSPI_TxBufferUnderrunInterruptEnable 

Tx buffer underrun interrupt enable.

kQSPI_IllegalInstructionInterruptEnable 

Illegal instruction error interrupt enable.

kQSPI_RxBufferOverflowInterruptEnable 

Rx buffer overflow interrupt enable.

kQSPI_RxBufferDrainInterruptEnable 

Rx buffer drain interrupt enable.

kQSPI_AHBSequenceErrorInterruptEnable 

AHB sequence error interrupt enable.

kQSPI_AHBIllegalTransactionInterruptEnable 

AHB illegal transaction error interrupt enable.

kQSPI_AHBIllegalBurstSizeInterruptEnable 

AHB illegal burst error interrupt enable.

kQSPI_AHBBufferOverflowInterruptEnable 

AHB buffer overflow interrupt enable.

kQSPI_IPCommandUsageErrorInterruptEnable 

IP command usage error interrupt enable.

kQSPI_IPCommandTriggerDuringAHBAccessInterruptEnable 

IP command trigger during AHB access error.

kQSPI_IPCommandTriggerDuringIPAccessInterruptEnable 

IP command trigger cannot be executed.

kQSPI_IPCommandTriggerDuringAHBGrantInterruptEnable 

IP command trigger during AHB grant error.

kQSPI_IPCommandTransactionFinishedInterruptEnable 

IP command transaction finished interrupt enable.

kQSPI_AllInterruptEnable 

All error interrupt enable.

Enumerator
kQSPI_TxBufferFillDMAEnable 

Tx buffer fill DMA.

kQSPI_RxBufferDrainDMAEnable 

Rx buffer drain DMA.

kQSPI_AllDDMAEnable 

All DMA source.

Enumerator
kQSPI_DQSNoPhraseShift 

No phase shift.

kQSPI_DQSPhraseShift45Degree 

Select 45 degree phase shift.

kQSPI_DQSPhraseShift90Degree 

Select 90 degree phase shift.

kQSPI_DQSPhraseShift135Degree 

Select 135 degree phase shift.

Function Documentation

void QSPI_Init ( QuadSPI_Type *  base,
qspi_config_t config,
uint32_t  srcClock_Hz 
)

This function enables the clock for QSPI and also configures the QSPI with the input configure parameters. Users should call this function before any QSPI operations.

Parameters
basePointer to QuadSPI Type.
configQSPI configure structure.
srcClock_HzQSPI source clock frequency in Hz.
void QSPI_GetDefaultQspiConfig ( qspi_config_t config)
Parameters
configQSPI configuration structure.
void QSPI_Deinit ( QuadSPI_Type *  base)

Clears the QSPI state and QSPI module registers.

Parameters
basePointer to QuadSPI Type.
void QSPI_SetFlashConfig ( QuadSPI_Type *  base,
qspi_flash_config_t config 
)

This function configures the serial flash relevant parameters, such as the size, command, and so on. The flash configuration value cannot have a default value. The user needs to configure it according to the QSPI features.

Parameters
basePointer to QuadSPI Type.
configFlash configuration parameters.
void QSPI_SoftwareReset ( QuadSPI_Type *  base)

This function sets the software reset flags for both AHB and buffer domain and resets both AHB buffer and also IP FIFOs.

Parameters
basePointer to QuadSPI Type.
static void QSPI_Enable ( QuadSPI_Type *  base,
bool  enable 
)
inlinestatic
Parameters
basePointer to QuadSPI Type.
enableTrue means enable QSPI, false means disable.
static uint32_t QSPI_GetStatusFlags ( QuadSPI_Type *  base)
inlinestatic
Parameters
basePointer to QuadSPI Type.
Returns
status flag, use status flag to AND _qspi_flags could get the related status.
static uint32_t QSPI_GetErrorStatusFlags ( QuadSPI_Type *  base)
inlinestatic
Parameters
basePointer to QuadSPI Type.
Returns
status flag, use status flag to AND _qspi_error_flags could get the related status.
static void QSPI_ClearErrorFlag ( QuadSPI_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
basePointer to QuadSPI Type.
maskWhich kind of QSPI flags to be cleared, a combination of _qspi_error_flags.
static void QSPI_EnableInterrupts ( QuadSPI_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
basePointer to QuadSPI Type.
maskQSPI interrupt source.
static void QSPI_DisableInterrupts ( QuadSPI_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
basePointer to QuadSPI Type.
maskQSPI interrupt source.
static void QSPI_EnableDMA ( QuadSPI_Type *  base,
uint32_t  mask,
bool  enable 
)
inlinestatic
Parameters
basePointer to QuadSPI Type.
maskQSPI DMA source.
enableTrue means enable DMA, false means disable.
static uint32_t QSPI_GetTxDataRegisterAddress ( QuadSPI_Type *  base)
inlinestatic

It is used for DMA operation.

Parameters
basePointer to QuadSPI Type.
Returns
QSPI Tx data register address.
uint32_t QSPI_GetRxDataRegisterAddress ( QuadSPI_Type *  base)

This function returns the Rx data register address or Rx buffer address according to the Rx read area settings.

Parameters
basePointer to QuadSPI Type.
Returns
QSPI Rx data register address.
static void QSPI_SetIPCommandAddress ( QuadSPI_Type *  base,
uint32_t  addr 
)
inlinestatic
Parameters
basePointer to QuadSPI Type.
addrIP command address.
static void QSPI_SetIPCommandSize ( QuadSPI_Type *  base,
uint32_t  size 
)
inlinestatic
Parameters
basePointer to QuadSPI Type.
sizeIP command size.
void QSPI_ExecuteIPCommand ( QuadSPI_Type *  base,
uint32_t  index 
)
Parameters
basePointer to QuadSPI Type.
indexIP command located in which LUT table index.
void QSPI_ExecuteAHBCommand ( QuadSPI_Type *  base,
uint32_t  index 
)
Parameters
basePointer to QuadSPI Type.
indexAHB command located in which LUT table index.
static void QSPI_EnableIPParallelMode ( QuadSPI_Type *  base,
bool  enable 
)
inlinestatic
Parameters
basePointer to QuadSPI Type.
enableTrue means enable parallel mode, false means disable parallel mode.
static void QSPI_EnableAHBParallelMode ( QuadSPI_Type *  base,
bool  enable 
)
inlinestatic
Parameters
basePointer to QuadSPI Type.
enableTrue means enable parallel mode, false means disable parallel mode.
void QSPI_UpdateLUT ( QuadSPI_Type *  base,
uint32_t  index,
uint32_t *  cmd 
)
Parameters
basePointer to QuadSPI Type.
indexWhich LUT index needs to be located. It should be an integer divided by 4.
cmdCommand sequence array.
static void QSPI_ClearFifo ( QuadSPI_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
basePointer to QuadSPI Type.
maskWhich kind of QSPI FIFO to be cleared.
static void QSPI_ClearCommandSequence ( QuadSPI_Type *  base,
qspi_command_seq_t  seq 
)
inlinestatic

This function can reset the command sequence.

Parameters
baseQSPI base address.
seqWhich command sequence need to reset, IP command, buffer command or both.
void QSPI_WriteBlocking ( QuadSPI_Type *  base,
uint32_t *  buffer,
size_t  size 
)
Note
This function blocks via polling until all bytes have been sent.
Parameters
baseQSPI base pointer
bufferThe data bytes to send
sizeThe number of data bytes to send
static void QSPI_WriteData ( QuadSPI_Type *  base,
uint32_t  data 
)
inlinestatic
Parameters
baseQSPI base pointer
dataThe data bytes to send
void QSPI_ReadBlocking ( QuadSPI_Type *  base,
uint32_t *  buffer,
size_t  size 
)
Note
This function blocks via polling until all bytes have been sent.
Parameters
baseQSPI base pointer
bufferThe data bytes to send
sizeThe number of data bytes to receive
uint32_t QSPI_ReadData ( QuadSPI_Type *  base)
Parameters
baseQSPI base pointer
Returns
The data in the FIFO.
static void QSPI_TransferSendBlocking ( QuadSPI_Type *  base,
qspi_transfer_t xfer 
)
inlinestatic

This function writes a continuous data to the QSPI transmit FIFO. This function is a block function and can return only when finished. This function uses polling methods.

Parameters
basePointer to QuadSPI Type.
xferQSPI transfer structure.
static void QSPI_TransferReceiveBlocking ( QuadSPI_Type *  base,
qspi_transfer_t xfer 
)
inlinestatic

This function reads continuous data from the QSPI receive buffer/FIFO. This function is a blocking function and can return only when finished. This function uses polling methods.

Parameters
basePointer to QuadSPI Type.
xferQSPI transfer structure.