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...
 

Detailed Description

RTOS-integrated Memory framework for QSPI NOR driver.

Name of module used by error logger macro

Macro Definition Documentation

◆ SF_MEMORY_QSPI_NOR_CODE_VERSION_MAJOR

#define SF_MEMORY_QSPI_NOR_CODE_VERSION_MAJOR   (2U)

Version of code that implements the API defined in this file

Function Documentation

◆ SF_MEMORY_QSPI_NOR_Close()

ssp_err_t SF_MEMORY_QSPI_NOR_Close ( sf_memory_ctrl_t *const  p_ctrl)

Close the Memory QSPI NOR driver module.

Return values
SSP_SUCCESSClose was successful.
SSP_ERR_ASSERTIONp_ctrl is NULL.
SSP_ERR_NOT_OPENDriver is not opened.
Returns
See Common Error Codes or functions called by this function for other possible return codes. This function calls:

Validate the parameters

Close the underlying QSPI

Mark instance as closed for future reference

◆ SF_MEMORY_QSPI_NOR_Erase()

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.

Return values
SSP_SUCCESSThe command to erase the flash was executed successfully.
SSP_ERR_ASSERTIONp_ctrl or memory_address is NULL.
SSP_ERR_INVALID_ARGUMENTInvalid num_bytes entered.
SSP_ERR_NOT_OPENDriver is not opened.
SSP_ERR_TIMEOUTWait timed out.
Returns
See Common Error Codes or functions called by this function for other possible return codes. This function calls

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

◆ SF_MEMORY_QSPI_NOR_Flush()

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.

Return values
SSP_SUCCESSNO error detected.
SSP_ERR_ASSERTIONp_ctrl is NULL.
SSP_ERR_NOT_OPENDriver is not opened.

Validate the parameters

Check whether instance is open or not

◆ SF_MEMORY_QSPI_NOR_InfoGet()

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.

Return values
SSP_SUCCESSMemory info structure updated successfully.
SSP_ERR_ASSERTIONp_ctrl or p_info is NULL.
SSP_ERR_NOT_OPENDriver is not opened.
Returns
InfoGet status.

Validate the parameters

Memory info is obtained while opening, use it

◆ SF_MEMORY_QSPI_NOR_Open()

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.

Return values
SSP_SUCCESSConfiguration was successful.
SSP_ERR_ASSERTIONThe parameter p_ctrl or p_cfg is NULL.
SSP_ERR_ALREADY_OPENDriver is already open.
Returns
See Common Error Codes or functions called by this function for other possible return codes. This function calls:

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

◆ SF_MEMORY_QSPI_NOR_Read()

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.

Return values
SSP_SUCCESSThe data read was successful.
SSP_ERR_ASSERTIONp_ctrl,p_dest_address or memory_address is NULL.
SSP_ERR_NOT_OPENDriver is not opened.
SSP_ERR_INVALID_ARGUMENTNumber of bytes requested are invalid.
SSP_ERR_TIMEOUTWait timed out.
Returns
See Common Error Codes or functions called by this function for other possible return codes. This function calls:

Validate the parameters

Check whether instance is open or not

Check whether the device address is valid

Read data from banks using ROM area.

◆ SF_MEMORY_QSPI_NOR_VersionGet()

ssp_err_t SF_MEMORY_QSPI_NOR_VersionGet ( ssp_version_t *const  p_version)

Get the driver version based on compile time macros.

Return values
SSP_SUCCESSSuccessful close.
SSP_ERR_ASSERTIONp_version is NULL.
Returns
API and Code version.

Validate the parameters

◆ SF_MEMORY_QSPI_NOR_Write()

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.

Return values
SSP_SUCCESSThe flash was programmed successfully.
SSP_ERR_ASSERTIONp_ctrl,p_src_address or memory_address is NULL.
SSP_ERR_INVALID_ARGUMENTInvalid parameter is passed.
SSP_ERR_NOT_OPENDriver is not opened.
SSP_ERR_TIMEOUTWait timed out.
Returns
See Common Error Codes or functions called by this function for other possible return codes. This function calls:

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