This module contains APIs to program and use the QSPI module. The APIs can be used by other drivers to get access to QSPI and also by application to initiate data transfer operation.
Files | |
file | qspi/v0/qspi.h |
QSPI Driver API/interface file. | |
Data Structures | |
struct | QSPI_Transaction |
Data structure used with QSPI_Transfers - QSPI_writeConfigMode, QSPI_readMemMapMode. More... | |
struct | QSPI_ReadCmdParams |
struct | QSPI_WriteCmdParams |
struct | QSPI_Params |
QSPI Parameters. More... | |
struct | QSPI_Object |
QSPI driver object. More... | |
struct | QSPI_Attrs |
QSPI instance attributes - used during init time. More... | |
struct | QSPI_Config |
Functions | |
void | QSPI_init (void) |
This function initializes the QSPI module. More... | |
void | QSPI_deinit (void) |
This function de-initializes the QSPI module. More... | |
void | QSPI_Params_init (QSPI_Params *qspiParams) |
Initialize data structure with defaults. More... | |
QSPI_Handle | QSPI_open (uint32_t index, const QSPI_Params *openParams) |
This function opens a given QSPI peripheral. More... | |
void | QSPI_close (QSPI_Handle handle) |
Function to close a QSPI peripheral specified by the QSPI handle. More... | |
QSPI_Handle | QSPI_getHandle (uint32_t index) |
This function returns the handle of an open QSPI Instance from the instance index. More... | |
uint32_t | QSPI_getInputClk (QSPI_Handle handle) |
This function returns the input clock at which QSPI was programmed. More... | |
void | QSPI_transaction_init (QSPI_Transaction *trans) |
Function to initialize the QSPI_Transaction structure. More... | |
void | QSPI_readCmdParams_init (QSPI_ReadCmdParams *rdParams) |
Function to initialize the QSPI_Transaction structure. More... | |
void | QSPI_writeCmdParams_init (QSPI_WriteCmdParams *wrParams) |
Function to initialize the QSPI_Transaction structure. More... | |
int32_t | QSPI_setPreScaler (QSPI_Handle handle, uint32_t clkDividerVal) |
Set the QSPI clock register divider value. More... | |
int32_t | QSPI_setWriteCmd (QSPI_Handle handle, uint8_t command) |
Function to set write command to be used. More... | |
int32_t | QSPI_setReadCmd (QSPI_Handle handle, uint8_t command) |
Function to set read command to be used. More... | |
int32_t | QSPI_setAddressByteCount (QSPI_Handle handle, uint32_t count) |
Function to set number of address bytes to be used. More... | |
int32_t | QSPI_setDummyBitCount (QSPI_Handle handle, uint32_t count) |
Function to set number of dummy bits to be used. More... | |
int32_t | QSPI_setMemAddrSpace (QSPI_Handle handle, uint32_t memMappedPortSwitch) |
This function is used to switch between memory mapped and configuration mode. More... | |
int32_t | QSPI_intEnable (QSPI_Handle handle, uint32_t intFlag) |
This function is used to enable word or frame complete interrupt. More... | |
int32_t | QSPI_intDisable (QSPI_Handle handle, uint32_t intFlag) |
This function is used to disable word or frame complete interrupt. More... | |
int32_t | QSPI_intClear (QSPI_Handle handle, uint32_t intFlag) |
This function is used to clear word or frame complete interrupt. More... | |
int32_t | QSPI_setRxLines (QSPI_Handle handle, uint32_t rxLines) |
Set QSPI Rx lines in the QSPI object. More... | |
uint32_t | QSPI_getRxLines (QSPI_Handle handle) |
Get QSPI Rx lines in the QSPI object. More... | |
void | OSPI_phyGetTuningData (uint32_t *phyTuningData, uint32_t *phyTuningDataSize) |
Typedefs | |
typedef void * | QSPI_Handle |
A handle that is returned from a QSPI_open() call. More... | |
Macros for invalid commands | |
Macros for invalid commands | |
#define | QSPI_CMD_INVALID_OPCODE (0xFFU) |
#define | QSPI_CMD_INVALID_ADDR (0xFFFFFFFFU) |
Transfer Status Code | |
Status codes that are set by the QSPI driver | |
#define | QSPI_TRANSFER_COMPLETED (0U) |
#define | QSPI_TRANSFER_STARTED (1U) |
#define | QSPI_TRANSFER_CANCELLED (2U) |
#define | QSPI_TRANSFER_FAILED (3U) |
#define | QSPI_TRANSFER_CSN_DEASSERT (4U) |
#define | QSPI_TRANSFER_TIMEOUT (5U) |
Different QSPI Transfer functions | |
int32_t | QSPI_readMemMapMode (QSPI_Handle handle, QSPI_Transaction *trans) |
Function to perform reads from the flash in memory mapped mode. More... | |
int32_t | QSPI_writeCmd (QSPI_Handle handle, QSPI_WriteCmdParams *wrParams) |
Function to send specific commands and related data to flash. More... | |
int32_t | QSPI_writeConfigMode (QSPI_Handle handle, const QSPI_Transaction *trans) |
Function to perform writes to the flash in configuration mode. More... | |
int32_t | QSPI_writeConfigModeIntr (QSPI_Handle handle, QSPI_WriteCmdParams *wrParams) |
Function to perform write to the flash in interrupt mode mode. More... | |
int32_t | QSPI_readCmd (QSPI_Handle handle, QSPI_ReadCmdParams *rdParams) |
Function to send specific commands and receive related data from flash. More... | |
int32_t | QSPI_readConfigModeIntr (QSPI_Handle handle, QSPI_ReadCmdParams *rdParams) |
Function to perform read from the flash in interrupt mode. More... | |
#define QSPI_CMD_INVALID_OPCODE (0xFFU) |
#define QSPI_CMD_INVALID_ADDR (0xFFFFFFFFU) |
#define QSPI_TRANSFER_COMPLETED (0U) |
#define QSPI_TRANSFER_STARTED (1U) |
#define QSPI_TRANSFER_CANCELLED (2U) |
#define QSPI_TRANSFER_FAILED (3U) |
#define QSPI_TRANSFER_CSN_DEASSERT (4U) |
#define QSPI_TRANSFER_TIMEOUT (5U) |
typedef void* QSPI_Handle |
A handle that is returned from a QSPI_open() call.
void QSPI_init | ( | void | ) |
This function initializes the QSPI module.
void QSPI_deinit | ( | void | ) |
This function de-initializes the QSPI module.
void QSPI_Params_init | ( | QSPI_Params * | qspiParams | ) |
Initialize data structure with defaults.
qspiParams | [out] Initialized parameters |
QSPI_Handle QSPI_open | ( | uint32_t | index, |
const QSPI_Params * | openParams | ||
) |
This function opens a given QSPI peripheral.
index | Index of config to use in the QSPI_Config array |
openParams | Pointer to parameters to open the driver with |
void QSPI_close | ( | QSPI_Handle | handle | ) |
Function to close a QSPI peripheral specified by the QSPI handle.
handle | QSPI_Handle returned from QSPI_open() |
QSPI_Handle QSPI_getHandle | ( | uint32_t | index | ) |
This function returns the handle of an open QSPI Instance from the instance index.
index | Index of config to use in the QSPI_Config array |
uint32_t QSPI_getInputClk | ( | QSPI_Handle | handle | ) |
This function returns the input clock at which QSPI was programmed.
handle | QSPI_Handle returned from QSPI_open() |
int32_t QSPI_readMemMapMode | ( | QSPI_Handle | handle, |
QSPI_Transaction * | trans | ||
) |
Function to perform reads from the flash in memory mapped mode.
handle | QSPI_Handle returned from QSPI_open() |
trans | Pointer to a QSPI_Transaction |
int32_t QSPI_writeCmd | ( | QSPI_Handle | handle, |
QSPI_WriteCmdParams * | wrParams | ||
) |
Function to send specific commands and related data to flash.
handle | QSPI_Handle returned from QSPI_open() |
wrParams | Pointer to a QSPI_WriteCmdParams |
int32_t QSPI_writeConfigMode | ( | QSPI_Handle | handle, |
const QSPI_Transaction * | trans | ||
) |
Function to perform writes to the flash in configuration mode.
handle | QSPI_Handle returned from QSPI_open() |
trans | Pointer to a QSPI_Transaction |
int32_t QSPI_writeConfigModeIntr | ( | QSPI_Handle | handle, |
QSPI_WriteCmdParams * | wrParams | ||
) |
Function to perform write to the flash in interrupt mode mode.
handle | QSPI_Handle returned from QSPI_open() |
wrParams | Pointer to a QSPI_WriteCmdParams |
int32_t QSPI_readCmd | ( | QSPI_Handle | handle, |
QSPI_ReadCmdParams * | rdParams | ||
) |
Function to send specific commands and receive related data from flash.
handle | QSPI_Handle returned from QSPI_open() |
rdParams | Pointer to a QSPI_ReadCmdParams |
int32_t QSPI_readConfigModeIntr | ( | QSPI_Handle | handle, |
QSPI_ReadCmdParams * | rdParams | ||
) |
Function to perform read from the flash in interrupt mode.
handle | QSPI_Handle returned from QSPI_open() |
rdParams | Pointer to a QSPI_ReadCmdParams |
void QSPI_transaction_init | ( | QSPI_Transaction * | trans | ) |
Function to initialize the QSPI_Transaction structure.
trans | Pointer to a QSPI_Transaction |
void QSPI_readCmdParams_init | ( | QSPI_ReadCmdParams * | rdParams | ) |
Function to initialize the QSPI_Transaction structure.
rdParams | Pointer to a QSPI_ReadCmdParams |
void QSPI_writeCmdParams_init | ( | QSPI_WriteCmdParams * | wrParams | ) |
Function to initialize the QSPI_Transaction structure.
wrParams | Pointer to a QSPI_WriteCmdParams |
int32_t QSPI_setPreScaler | ( | QSPI_Handle | handle, |
uint32_t | clkDividerVal | ||
) |
Set the QSPI clock register divider value.
This function sets the QSPI clock control register with serial data clock divider ratio (DCLK_DIV) according to the input clock provided and the output clock required. DCLK_DIV = ((input clock) / (output clock)) - 1. This function also enables the clock for QSPI module. This can only be done if QSPI module is not busy.
handle | A QSPI_Handle returned from a QSPI_open() |
clkDividerVal | Clock divider value to be set. |
int32_t QSPI_setWriteCmd | ( | QSPI_Handle | handle, |
uint8_t | command | ||
) |
Function to set write command to be used.
handle | QSPI_Handle returned from QSPI_open() |
command | Write command for a particular flash |
int32_t QSPI_setReadCmd | ( | QSPI_Handle | handle, |
uint8_t | command | ||
) |
Function to set read command to be used.
handle | QSPI_Handle returned from QSPI_open() |
command | Read command for a particular flash |
int32_t QSPI_setAddressByteCount | ( | QSPI_Handle | handle, |
uint32_t | count | ||
) |
Function to set number of address bytes to be used.
handle | QSPI_Handle returned from QSPI_open() |
count | Number of Address Bytes. This function should always be called before accessing a memory location that doesn't fit in the current address byte range. |
int32_t QSPI_setDummyBitCount | ( | QSPI_Handle | handle, |
uint32_t | count | ||
) |
Function to set number of dummy bits to be used.
handle | QSPI_Handle returned from QSPI_open() |
count | Number of Dummy Bits. This should be either less than 8 or a multiple of 8, because Bit count field in setup register works only if Byte count is 0. |
int32_t QSPI_setMemAddrSpace | ( | QSPI_Handle | handle, |
uint32_t | memMappedPortSwitch | ||
) |
This function is used to switch between memory mapped and configuration mode.
handle | A QSPI_Handle returned from a QSPI_open() |
memMappedPortSwitch | Flag for switching mode. |
int32_t QSPI_intEnable | ( | QSPI_Handle | handle, |
uint32_t | intFlag | ||
) |
This function is used to enable word or frame complete interrupt.
handle | A QSPI_Handle returned from a QSPI_open() |
intFlag | Flag for enabling interrupt. |
int32_t QSPI_intDisable | ( | QSPI_Handle | handle, |
uint32_t | intFlag | ||
) |
This function is used to disable word or frame complete interrupt.
handle | A QSPI_Handle returned from a QSPI_open() |
intFlag | Flag for disabling interrupt. |
int32_t QSPI_intClear | ( | QSPI_Handle | handle, |
uint32_t | intFlag | ||
) |
This function is used to clear word or frame complete interrupt.
handle | A QSPI_Handle returned from a QSPI_open() |
intFlag | Flag for clearing interrupt. |
int32_t QSPI_setRxLines | ( | QSPI_Handle | handle, |
uint32_t | rxLines | ||
) |
Set QSPI Rx lines in the QSPI object.
This function sets the QSPI RX lines in QSPI object so that it can be used in a subsequent read
handle | A QSPI_Handle returned from a QSPI_open() |
rxLines | QSPI_TransferLines value |
uint32_t QSPI_getRxLines | ( | QSPI_Handle | handle | ) |
Get QSPI Rx lines in the QSPI object.
This function returns the QSPI RX lines in QSPI object
handle | A QSPI_Handle returned from a QSPI_open() |
void OSPI_phyGetTuningData | ( | uint32_t * | phyTuningData, |
uint32_t * | phyTuningDataSize | ||
) |
|
extern |
Externally defined driver configuration array.
|
extern |
Externally defined driver configuration array size.
QSPI_EdmaParams gqspiEdmaParam |
EDMA Paramter for QSPI Transaction.