![]() |
S32 SDK
|
Data Structures | |
struct | qspi_user_config_t |
Driver configuration structure. More... | |
struct | qspi_ahb_config_t |
AHB configuration structure. More... | |
struct | qspi_state_t |
Driver internal context structure. More... | |
Macros | |
#define | QSPI_AHB_BUFFERS 4 |
Number of AHB buffers in the device. More... | |
#define | QSPI_LUT_LOCK_KEY 0x5AF05AF0U |
Key to lock/unlock LUT. More... | |
Typedefs | |
typedef void(* | qspi_callback_t) (uint32_t instance, void *param) |
QuadSPI callback function type. More... | |
Variables | |
QuadSPI_Type *const | g_qspiBase [] |
Table of base addresses for QuadSPI instances. More... | |
QuadSPI Driver | |
status_t | QSPI_DRV_Init (uint32_t instance, const qspi_user_config_t *userConfigPtr, qspi_state_t *state) |
Initializes the qspi driver. More... | |
status_t | QSPI_DRV_Deinit (uint32_t instance) |
De-initialize the qspi driver. More... | |
status_t | QSPI_DRV_GetDefaultConfig (qspi_user_config_t *userConfigPtr) |
Returns default configuration structure for QuadSPI. More... | |
status_t | QSPI_DRV_AhbSetup (uint32_t instance, const qspi_ahb_config_t *config) |
Sets up AHB accesses to the serial flash. More... | |
static void | QSPI_DRV_SetLut (uint32_t instance, uint8_t lut, qspi_lut_commands_t instr0, qspi_lut_pads_t pad0, uint8_t oprnd0, qspi_lut_commands_t instr1, qspi_lut_pads_t pad1, uint8_t oprnd1) |
Configures LUT commands. More... | |
static void | QSPI_DRV_LockLut (uint32_t instance) |
Locks LUT table. More... | |
static void | QSPI_DRV_UnlockLut (uint32_t instance) |
Unlocks LUT table. More... | |
static void | QSPI_DRV_ClearIpSeqPointer (uint32_t instance) |
Clears IP sequence pointer. More... | |
static void | QSPI_DRV_ClearAHBSeqPointer (uint32_t instance) |
Clears AHB sequence pointer. More... | |
static void | QSPI_DRV_SetAhbSeqId (uint32_t instance, uint8_t seqID) |
Sets sequence ID for AHB operations. More... | |
status_t | QSPI_DRV_IpCommand (uint32_t instance, uint8_t lut, uint32_t timeout) |
Launches a simple IP command. More... | |
status_t | QSPI_DRV_IpRead (uint32_t instance, uint8_t lut, uint32_t addr, uint8_t *dataRead, const uint8_t *dataCmp, uint32_t size, qspi_transfer_type_t transferType, uint32_t timeout) |
Launches an IP read command. More... | |
status_t | QSPI_DRV_IpWrite (uint32_t instance, uint8_t lut, uint32_t addr, uint8_t *data, uint32_t size, qspi_transfer_type_t transferType, uint32_t timeout) |
Launches an IP write command. More... | |
status_t | QSPI_DRV_IpErase (uint32_t instance, uint8_t lut, uint32_t addr) |
Launches an IP erase command. More... | |
status_t | QSPI_DRV_IpGetStatus (uint32_t instance) |
Checks the status of the currently running IP command. More... | |
#define QSPI_AHB_BUFFERS 4 |
Number of AHB buffers in the device.
Definition at line 37 of file quadspi_driver.h.
#define QSPI_LUT_LOCK_KEY 0x5AF05AF0U |
Key to lock/unlock LUT.
Definition at line 41 of file quadspi_driver.h.
typedef void(* qspi_callback_t) (uint32_t instance, void *param) |
QuadSPI callback function type.
Definition at line 166 of file quadspi_driver.h.
enum qspi_clock_src_t |
Source of QuadSPI internal reference clock Implements : qspi_clock_src_t_Class.
Enumerator | |
---|---|
QSPI_CLK_SRC_PLL_DIV1 |
PLL_DIV1 is clock source of QuadSPI internal reference clock |
QSPI_CLK_SRC_FIRC_DIV1 |
FIRC_DIV1 is clock source of QuadSPI internal reference clock |
Definition at line 116 of file quadspi_driver.h.
enum qspi_date_rate_t |
Clock phase used for sampling Rx data Implements : qspi_date_rate_t_Class.
Enumerator | |
---|---|
QSPI_DATE_RATE_SDR |
Single data rate |
QSPI_DATE_RATE_DDR |
Double data rate |
Definition at line 125 of file quadspi_driver.h.
enum qspi_endianess_t |
Endianess options Implements : qspi_endianess_t_Class.
Enumerator | |
---|---|
QSPI_END_64BIT_BE |
64-bit, Big Endian |
QSPI_END_32BIT_LE |
32-bit, Little Endian |
QSPI_END_32BIT_BE |
32-bit, Big Endian |
QSPI_END_64BIT_LE |
64-bit, Little Endian |
Definition at line 105 of file quadspi_driver.h.
enum qspi_flash_side_t |
External flash connection options (side A/B) Implements : qspi_flash_side_t_Class.
Enumerator | |
---|---|
QSPI_FLASH_SIDE_A |
Serial flash connected to A-side |
QSPI_FLASH_SIDE_B |
Serial flash connected to B-side |
Definition at line 135 of file quadspi_driver.h.
enum qspi_lut_commands_t |
Lut commands Implements : qspi_lut_commands_t_Class.
Definition at line 46 of file quadspi_driver.h.
enum qspi_lut_pads_t |
Lut pad options Implements : qspi_lut_pads_t_Class.
Enumerator | |
---|---|
QSPI_LUT_PADS_1 |
1 Pad |
QSPI_LUT_PADS_2 |
2 Pads |
QSPI_LUT_PADS_4 |
4 Pads |
QSPI_LUT_PADS_8 |
8 Pads |
Definition at line 72 of file quadspi_driver.h.
enum qspi_read_mode_t |
Read mode Implements : qspi_read_mode_t_Class.
Definition at line 94 of file quadspi_driver.h.
enum qspi_sample_delay_t |
Delay used for sampling Rx data Implements : qspi_sample_delay_t_Class.
Enumerator | |
---|---|
QSPI_SAMPLE_DELAY_1 |
One clock cycle delay |
QSPI_SAMPLE_DELAY_2 |
Two clock cycles delay |
Definition at line 145 of file quadspi_driver.h.
enum qspi_sample_phase_t |
Clock phase used for sampling Rx data Implements : qspi_sample_phase_t_Class.
Enumerator | |
---|---|
QSPI_SAMPLE_PHASE_NON_INVERTED |
Sampling at non-inverted clock |
QSPI_SAMPLE_PHASE_INVERTED |
Sampling at inverted clock |
Definition at line 154 of file quadspi_driver.h.
enum qspi_transfer_type_t |
Driver type Implements : qspi_transfer_type_t_Class.
Enumerator | |
---|---|
QSPI_TRANSFER_TYPE_SYNC |
Synchronous transfer using polling |
QSPI_TRANSFER_TYPE_ASYNC_INT |
Interrupt-based asynchronous transfer |
QSPI_TRANSFER_TYPE_ASYNC_DMA |
DMA-based asynchronous transfer |
Definition at line 83 of file quadspi_driver.h.
status_t QSPI_DRV_AhbSetup | ( | uint32_t | instance, |
const qspi_ahb_config_t * | config | ||
) |
Sets up AHB accesses to the serial flash.
instance | QuadSPI peripheral instance number |
config | AHB configuration structure |
Definition at line 593 of file quadspi_driver.c.
|
inlinestatic |
Clears AHB sequence pointer.
instance | QuadSPI peripheral instance number Implements : QSPI_DRV_ClearAHBSeqPointer_Activity |
Definition at line 407 of file quadspi_driver.h.
|
inlinestatic |
Clears IP sequence pointer.
instance | QuadSPI peripheral instance number Implements : QSPI_DRV_ClearIpSeqPointer_Activity |
Definition at line 391 of file quadspi_driver.h.
status_t QSPI_DRV_Deinit | ( | uint32_t | instance | ) |
De-initialize the qspi driver.
This function de-initializes the qspi driver. The driver can't be used again until reinitialized. The context structure is no longer needed by the driver and can be freed after calling this function.
instance | QuadSPI peripheral instance number |
Definition at line 567 of file quadspi_driver.c.
status_t QSPI_DRV_GetDefaultConfig | ( | qspi_user_config_t * | userConfigPtr | ) |
Returns default configuration structure for QuadSPI.
userConfigPtr | Pointer to the qspi user configuration structure. |
Definition at line 874 of file quadspi_driver.c.
status_t QSPI_DRV_Init | ( | uint32_t | instance, |
const qspi_user_config_t * | userConfigPtr, | ||
qspi_state_t * | state | ||
) |
Initializes the qspi driver.
This function initializes the qspi driver and prepares it for operation.
instance | QuadSPI peripheral instance number |
userConfigPtr | Pointer to the qspi user configuration structure. The function reads configuration data from this structure and initializes the driver accordingly. The application may free this structure after the function returns. |
master | Pointer to the qspi context structure. The driver uses this memory area for its internal logic. The application must make no assumptions about the content of this structure, and must not free this memory until the driver is de-initialized using QSPI_DRV_Deinit(). |
Definition at line 482 of file quadspi_driver.c.
status_t QSPI_DRV_IpCommand | ( | uint32_t | instance, |
uint8_t | lut, | ||
uint32_t | timeout | ||
) |
Launches a simple IP command.
instance | QuadSPI peripheral instance number |
lut | Index of LUT register |
timeout | timeout for the transfer in milliseconds |
Definition at line 616 of file quadspi_driver.c.
status_t QSPI_DRV_IpErase | ( | uint32_t | instance, |
uint8_t | lut, | ||
uint32_t | addr | ||
) |
Launches an IP erase command.
instance | QuadSPI peripheral instance number |
lut | Index of LUT register |
addr | Start address of erased sector |
Definition at line 822 of file quadspi_driver.c.
status_t QSPI_DRV_IpGetStatus | ( | uint32_t | instance | ) |
Checks the status of the currently running IP command.
instance | QuadSPI peripheral instance number |
Definition at line 851 of file quadspi_driver.c.
status_t QSPI_DRV_IpRead | ( | uint32_t | instance, |
uint8_t | lut, | ||
uint32_t | addr, | ||
uint8_t * | dataRead, | ||
const uint8_t * | dataCmp, | ||
uint32_t | size, | ||
qspi_transfer_type_t | transferType, | ||
uint32_t | timeout | ||
) |
Launches an IP read command.
This function can launch a read command in 3 modes:
instance | QuadSPI peripheral instance number |
lut | Index of LUT register |
addr | Start address for read operation in serial flash |
dataRead | Buffer where to store read data |
dataCmp | Buffer to be compared to read data |
size | Size of data buffer |
transferType | Type of transfer |
timeout | timeout for the transfer in milliseconds; only applies for synchronous transfers |
Definition at line 651 of file quadspi_driver.c.
status_t QSPI_DRV_IpWrite | ( | uint32_t | instance, |
uint8_t | lut, | ||
uint32_t | addr, | ||
uint8_t * | data, | ||
uint32_t | size, | ||
qspi_transfer_type_t | transferType, | ||
uint32_t | timeout | ||
) |
Launches an IP write command.
instance | QuadSPI peripheral instance number |
lut | Index of LUT register |
addr | Start address for write operation in serial flash |
data | Data to be programmed in flash |
size | Size of data buffer |
transferType | Type of transfer |
timeout | timeout for the transfer in milliseconds; only applies for synchronous transfers |
Definition at line 744 of file quadspi_driver.c.
|
inlinestatic |
Locks LUT table.
instance | QuadSPI peripheral instance number Implements : QSPI_DRV_LockLut_Activity |
Definition at line 356 of file quadspi_driver.h.
|
inlinestatic |
Sets sequence ID for AHB operations.
instance | QuadSPI peripheral instance number |
seqID | Sequence ID in LUT for read operation Implements : QSPI_DRV_SetAhbSeqId_Activity |
Definition at line 424 of file quadspi_driver.h.
|
inlinestatic |
Configures LUT commands.
This function configures a pair of LUT commands in the specified LUT register. LUT sequences start at index multiple of 4 and can have up to 8 commands
instance | QuadSPI peripheral instance number |
lut | Index of LUT register |
instr0 | First instruction |
pad0 | Number of pads to use for first instruction |
oprnd0 | Operand for first instruction |
instr1 | Second instruction |
pad1 | Number of pads to use for second instruction |
oprnd1 | Operand for second instruction Implements : QSPI_DRV_SetLut_Activity |
Definition at line 327 of file quadspi_driver.h.
|
inlinestatic |
Unlocks LUT table.
instance | QuadSPI peripheral instance number Implements : QSPI_DRV_UnlockLut_Activity |
Definition at line 374 of file quadspi_driver.h.
QuadSPI_Type* const g_qspiBase[] |
Table of base addresses for QuadSPI instances.