![]() |
Synergy Software Package User's Manual
|
RTOS-integrated Memory framework for QSPI NOR driver. More...
Data Structures | |
| struct | sf_memory_qspi_nor_instance_ctrl_t |
| struct | sf_memory_qspi_nor_cfg_t |
Macros | |
| #define | SF_MEMORY_QSPI_NOR_CODE_VERSION_MAJOR (2U) |
Functions | |
| ssp_err_t | SF_MEMORY_QSPI_NOR_Open (sf_memory_ctrl_t *const p_ctrl, sf_memory_cfg_t const *const p_cfg) |
| Open the SF Memory QSPI Nor driver module. More... | |
| ssp_err_t | SF_MEMORY_QSPI_NOR_Close (sf_memory_ctrl_t *const p_ctrl) |
| Close the Memory QSPI NOR driver module. More... | |
| ssp_err_t | SF_MEMORY_QSPI_NOR_Read (sf_memory_ctrl_t *const p_ctrl, uint8_t *const p_dest_address, uint32_t const memory_address, uint32_t const num_bytes) |
| Read data from the flash. More... | |
| ssp_err_t | SF_MEMORY_QSPI_NOR_Write (sf_memory_ctrl_t *const p_ctrl, uint8_t *const p_src_address, uint32_t const memory_address, uint32_t const num_bytes) |
| Program data to the flash. More... | |
| ssp_err_t | SF_MEMORY_QSPI_NOR_Flush (sf_memory_ctrl_t *const p_ctrl) |
| Flush any pending data to the disk. This is not required for QSPI NOR Flash. More... | |
| ssp_err_t | SF_MEMORY_QSPI_NOR_Erase (sf_memory_ctrl_t *p_ctrl, uint32_t const memory_address, uint32_t const num_bytes) |
| Erase a number of bytes from the flash. More... | |
| ssp_err_t | SF_MEMORY_QSPI_NOR_InfoGet (sf_memory_ctrl_t *const p_ctrl, sf_memory_info_t *const p_info) |
| Returns the information about the flash. More... | |
| ssp_err_t | SF_MEMORY_QSPI_NOR_VersionGet (ssp_version_t *const p_version) |
| Get the driver version based on compile time macros. More... | |
RTOS-integrated Memory framework for QSPI NOR driver.
Name of module used by error logger macro
| #define SF_MEMORY_QSPI_NOR_CODE_VERSION_MAJOR (2U) |
Version of code that implements the API defined in this file
| ssp_err_t SF_MEMORY_QSPI_NOR_Close | ( | sf_memory_ctrl_t *const | p_ctrl | ) |
Close the Memory QSPI NOR driver module.
| SSP_SUCCESS | Close was successful. |
| SSP_ERR_ASSERTION | p_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | Driver is not opened. |
Validate the parameters
Close the underlying QSPI
Mark instance as closed for future reference
| ssp_err_t SF_MEMORY_QSPI_NOR_Erase | ( | sf_memory_ctrl_t * | p_ctrl, |
| uint32_t const | memory_address, | ||
| uint32_t const | num_bytes | ||
| ) |
Erase a number of bytes from the flash.
| SSP_SUCCESS | The command to erase the flash was executed successfully. |
| SSP_ERR_ASSERTION | p_ctrl or memory_address is NULL. |
| SSP_ERR_INVALID_ARGUMENT | Invalid num_bytes entered. |
| SSP_ERR_NOT_OPEN | Driver is not opened. |
| SSP_ERR_TIMEOUT | Wait timed out. |
Validate the parameters
Check whether instance is open or not
Check whether the device address is valid
Calculate maximum erase size
Check whether we have valid erase size
| ssp_err_t SF_MEMORY_QSPI_NOR_Flush | ( | sf_memory_ctrl_t *const | p_ctrl | ) |
Flush any pending data to the disk. This is not required for QSPI NOR Flash.
| SSP_SUCCESS | NO error detected. |
| SSP_ERR_ASSERTION | p_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | Driver is not opened. |
Validate the parameters
Check whether instance is open or not
| ssp_err_t SF_MEMORY_QSPI_NOR_InfoGet | ( | sf_memory_ctrl_t *const | p_ctrl, |
| sf_memory_info_t *const | p_info | ||
| ) |
Returns the information about the flash.
| SSP_SUCCESS | Memory info structure updated successfully. |
| SSP_ERR_ASSERTION | p_ctrl or p_info is NULL. |
| SSP_ERR_NOT_OPEN | Driver is not opened. |
Validate the parameters
Memory info is obtained while opening, use it
| ssp_err_t SF_MEMORY_QSPI_NOR_Open | ( | sf_memory_ctrl_t *const | p_ctrl, |
| sf_memory_cfg_t const *const | p_cfg | ||
| ) |
Open the SF Memory QSPI Nor driver module.
Open the SF Memory QSPI Nor driver module for the purposes of reading and writing flash memory.
| SSP_SUCCESS | Configuration was successful. |
| SSP_ERR_ASSERTION | The parameter p_ctrl or p_cfg is NULL. |
| SSP_ERR_ALREADY_OPEN | Driver is already open. |
Validate the parameters
Check whether the framework is in already open state
Update instance control with the lower level driver and configuration information.
Open the QSPI driver
Update the memory info
Close QSPI in case of failure
Mark instance as open for future reference
| ssp_err_t SF_MEMORY_QSPI_NOR_Read | ( | sf_memory_ctrl_t *const | p_ctrl, |
| uint8_t *const | p_dest_address, | ||
| uint32_t const | memory_address, | ||
| uint32_t const | num_bytes | ||
| ) |
Read data from the flash.
Read specified number of bytes of data from a particular address on the QSPI flash device.
| SSP_SUCCESS | The data read was successful. |
| SSP_ERR_ASSERTION | p_ctrl,p_dest_address or memory_address is NULL. |
| SSP_ERR_NOT_OPEN | Driver is not opened. |
| SSP_ERR_INVALID_ARGUMENT | Number of bytes requested are invalid. |
| SSP_ERR_TIMEOUT | Wait timed out. |
Validate the parameters
Check whether instance is open or not
Check whether the device address is valid
Read data from banks using ROM area.
| ssp_err_t SF_MEMORY_QSPI_NOR_VersionGet | ( | ssp_version_t *const | p_version | ) |
Get the driver version based on compile time macros.
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | p_version is NULL. |
Validate the parameters
| ssp_err_t SF_MEMORY_QSPI_NOR_Write | ( | sf_memory_ctrl_t *const | p_ctrl, |
| uint8_t *const | p_src_address, | ||
| uint32_t const | memory_address, | ||
| uint32_t const | num_bytes | ||
| ) |
Program data to the flash.
| SSP_SUCCESS | The flash was programmed successfully. |
| SSP_ERR_ASSERTION | p_ctrl,p_src_address or memory_address is NULL. |
| SSP_ERR_INVALID_ARGUMENT | Invalid parameter is passed. |
| SSP_ERR_NOT_OPEN | Driver is not opened. |
| SSP_ERR_TIMEOUT | Wait timed out. |
Validate the parameters
Check whether instance is open or not
Check whether the device address is valid
Check whether page size of QSPI NOR is larger than the read buffer size
Calculate current write size
Copy data from source address to a buffer for write if the source address is within address range of QSPI NOR
Program using underlying QSPI driver
Wait if there is any write operation in progress