MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
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... | |
struct | ip_command_config_t |
16-bit access reg for IPCR register More... | |
Macros | |
#define | QSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) |
Macro functions for LUT table. | |
#define | QSPI_CMD (0x1U) |
Macro for QSPI LUT command. | |
#define | QSPI_PAD_1 (0x0U) |
Macro for QSPI PAD. | |
Driver version | |
#define | FSL_QSPI_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) |
QSPI driver version 2.2.0. More... | |
Initialization and deinitialization | |
uint32_t | QSPI_GetInstance (QuadSPI_Type *base) |
Get the instance number for QSPI. More... | |
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_SetDqsConfig (QuadSPI_Type *base, qspi_dqs_config_t *config) |
Configures the serial flash DQS 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... | |
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... | |
static void | QSPI_EnableDDRMode (QuadSPI_Type *base, bool enable) |
Enable or disable DDR mode. More... | |
void | QSPI_SetReadDataArea (QuadSPI_Type *base, qspi_read_area_t area) |
@ brief Set the RX buffer readout area. 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... | |
struct qspi_dqs_config_t |
Data Fields | |
uint32_t | portADelayTapNum |
Delay chain tap number selection for QSPI port A DQS. | |
qspi_dqs_phrase_shift_t | shift |
Phase shift for internal DQS generation. | |
qspi_dqs_read_sample_clock_t | rxSampleClock |
Read sample clock for Dqs. More... | |
bool | enableDQSClkInverse |
Enable inverse clock for internal DQS generation. | |
qspi_dqs_read_sample_clock_t qspi_dqs_config_t::rxSampleClock |
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. | |
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 | 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... | |
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 |
struct ip_command_config_t |
#define FSL_QSPI_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) |
enum _status_t |
enum qspi_read_area_t |
enum qspi_command_seq_t |
enum qspi_fifo_t |
enum qspi_endianness_t |
enum _qspi_error_flags |
enum _qspi_flags |
enum _qspi_dma_enable |
uint32_t QSPI_GetInstance | ( | QuadSPI_Type * | base | ) |
base | QSPI base pointer. |
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.
base | Pointer to QuadSPI Type. |
config | QSPI configure structure. |
srcClock_Hz | QSPI source clock frequency in Hz. |
void QSPI_GetDefaultQspiConfig | ( | qspi_config_t * | config | ) |
config | QSPI configuration structure. |
void QSPI_Deinit | ( | QuadSPI_Type * | base | ) |
Clears the QSPI state and QSPI module registers.
base | Pointer 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.
base | Pointer to QuadSPI Type. |
config | Flash configuration parameters. |
void QSPI_SetDqsConfig | ( | QuadSPI_Type * | base, |
qspi_dqs_config_t * | config | ||
) |
This function configures the serial flash DQS relevant parameters, such as the delay chain tap number, . DQS shift phase, whether need to inverse and the rxc sample clock selection.
base | Pointer to QuadSPI Type. |
config | Dqs 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.
base | Pointer to QuadSPI Type. |
|
inlinestatic |
base | Pointer to QuadSPI Type. |
enable | True means enable QSPI, false means disable. |
|
inlinestatic |
base | Pointer to QuadSPI Type. |
|
inlinestatic |
base | Pointer to QuadSPI Type. |
|
inlinestatic |
base | Pointer to QuadSPI Type. |
mask | Which kind of QSPI flags to be cleared, a combination of _qspi_error_flags. |
|
inlinestatic |
base | Pointer to QuadSPI Type. |
mask | QSPI interrupt source. |
|
inlinestatic |
base | Pointer to QuadSPI Type. |
mask | QSPI interrupt source. |
|
inlinestatic |
base | Pointer to QuadSPI Type. |
mask | QSPI DMA source. |
enable | True means enable DMA, false means disable. |
|
inlinestatic |
It is used for DMA operation.
base | Pointer to QuadSPI Type. |
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.
base | Pointer to QuadSPI Type. |
|
inlinestatic |
base | Pointer to QuadSPI Type. |
addr | IP command address. |
|
inlinestatic |
base | Pointer to QuadSPI Type. |
size | IP command size. |
void QSPI_ExecuteIPCommand | ( | QuadSPI_Type * | base, |
uint32_t | index | ||
) |
base | Pointer to QuadSPI Type. |
index | IP command located in which LUT table index. |
void QSPI_ExecuteAHBCommand | ( | QuadSPI_Type * | base, |
uint32_t | index | ||
) |
base | Pointer to QuadSPI Type. |
index | AHB command located in which LUT table index. |
void QSPI_UpdateLUT | ( | QuadSPI_Type * | base, |
uint32_t | index, | ||
uint32_t * | cmd | ||
) |
base | Pointer to QuadSPI Type. |
index | Which LUT index needs to be located. It should be an integer divided by 4. |
cmd | Command sequence array. |
|
inlinestatic |
base | Pointer to QuadSPI Type. |
mask | Which kind of QSPI FIFO to be cleared. |
|
inlinestatic |
This function can reset the command sequence.
base | QSPI base address. |
seq | Which command sequence need to reset, IP command, buffer command or both. |
|
inlinestatic |
base | QSPI base pointer |
eanble | True means enable DDR mode, false means disable DDR mode. |
void QSPI_SetReadDataArea | ( | QuadSPI_Type * | base, |
qspi_read_area_t | area | ||
) |
This function can set the RX buffer readout, from AHB bus or IP Bus.
base | QSPI base address. |
area | QSPI Rx buffer readout area. AHB bus buffer or IP bus buffer. |
void QSPI_WriteBlocking | ( | QuadSPI_Type * | base, |
uint32_t * | buffer, | ||
size_t | size | ||
) |
base | QSPI base pointer |
buffer | The data bytes to send |
size | The number of data bytes to send |
|
inlinestatic |
base | QSPI base pointer |
data | The data bytes to send |
void QSPI_ReadBlocking | ( | QuadSPI_Type * | base, |
uint32_t * | buffer, | ||
size_t | size | ||
) |
base | QSPI base pointer |
buffer | The data bytes to send |
size | The number of data bytes to receive |
uint32_t QSPI_ReadData | ( | QuadSPI_Type * | base | ) |
base | QSPI base pointer |
|
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.
base | Pointer to QuadSPI Type. |
xfer | QSPI transfer structure. |
|
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. Users shall notice that this receive size shall not bigger than 64 bytes. As this interface is used to read flash status registers. For flash contents read, please use AHB bus read, this is much more efficiency.
base | Pointer to QuadSPI Type. |
xfer | QSPI transfer structure. |