Synergy Software Package User's Manual

LevelX NOR driver implementation. More...

Data Structures

struct  sf_el_lx_nor_memory_settings_t
 
struct  sf_el_lx_nor_callback_args_t
 
struct  sf_el_lx_nor_instance_ctrl_t
 
struct  sf_el_lx_nor_instance_cfg_t
 

Macros

#define SF_EL_LX_NOR_API_VERSION_MAJOR   (2U)
 
#define SF_EL_LX_NOR_CODE_VERSION_MAJOR   (2U)
 

Enumerations

enum  sf_el_lx_nor_event_t { SF_EL_LX_NOR_EVENT_BLOCK_ERASE }
 

Functions

ssp_err_t SF_EL_LX_NOR_Open (sf_el_lx_nor_instance_ctrl_t *const p_ctrl, sf_el_lx_nor_instance_cfg_t const *const p_cfg)
 Initializes LevelX NOR frame work read/write and control. More...
 
ssp_err_t SF_EL_LX_NOR_Read (sf_el_lx_nor_instance_ctrl_t *const p_ctrl, ULONG *const p_flash, ULONG *const p_dest, ULONG word_count)
 LevelX NOR driver "read sector" service. More...
 
ssp_err_t SF_EL_LX_NOR_Write (sf_el_lx_nor_instance_ctrl_t *const p_ctrl, ULONG *const p_flash, ULONG *const p_src, ULONG word_count)
 LevelX NOR driver "write sector" service. More...
 
ssp_err_t SF_EL_LX_NOR_BlockErase (sf_el_lx_nor_instance_ctrl_t *const p_ctrl, ULONG block, ULONG erase_count)
 LevelX NOR driver "block erase" service. More...
 
ssp_err_t SF_EL_LX_NOR_BlockErasedVerify (sf_el_lx_nor_instance_ctrl_t *const p_ctrl, ULONG block)
 LevelX NOR driver "block erased verify" service. More...
 
ssp_err_t SF_EL_LX_NOR_Close (sf_el_lx_nor_instance_ctrl_t *const p_ctrl)
 LevelX NOR driver close service. More...
 

Detailed Description

LevelX NOR driver implementation.

Macro Definition Documentation

◆ SF_EL_LX_NOR_API_VERSION_MAJOR

#define SF_EL_LX_NOR_API_VERSION_MAJOR   (2U)

Common macro for SSP header files. There is also a corresponding SSP_FOOTER macro at the end of this file. Version of the API defined in this file

◆ SF_EL_LX_NOR_CODE_VERSION_MAJOR

#define SF_EL_LX_NOR_CODE_VERSION_MAJOR   (2U)

Version of code that implements the API defined in this file

Enumeration Type Documentation

◆ sf_el_lx_nor_event_t

Options for the callback events.

Enumerator
SF_EL_LX_NOR_EVENT_BLOCK_ERASE 

Block erase event triggered.

Function Documentation

◆ SF_EL_LX_NOR_BlockErase()

ssp_err_t SF_EL_LX_NOR_BlockErase ( sf_el_lx_nor_instance_ctrl_t *const  p_ctrl,
ULONG  block,
ULONG  erase_count 
)

LevelX NOR driver "block erase" service.

This is responsible for erasing the specified block of the NOR flash.

Parameters
[in]p_ctrlControl block for the LevelX NOR framework instance.
[in]blockSpecifies which NOR block to erase.
[in]erase_countProvided for diagnostic purposes(currently unused).
Return values
SSP_SUCCESSLevelX NOR flash block erase successful.
SSP_ERR_ASSERTIONp_ctrl is NULL.
SSP_ERR_NOT_OPENDriver not in OPEN state for erasing.
Returns
See Common Error Codes or lower level drivers for other possible return codes. This function calls

Validate the parameters

If the driver is not open return an error.

Calculate the block address

Erase using underlying API

Call the user function if available

Prepare the callback arguments

Invoke callback function

◆ SF_EL_LX_NOR_BlockErasedVerify()

ssp_err_t SF_EL_LX_NOR_BlockErasedVerify ( sf_el_lx_nor_instance_ctrl_t *const  p_ctrl,
ULONG  block 
)

LevelX NOR driver "block erased verify" service.

This is responsible for verifying the specified block of the NOR flash is erased.

Parameters
[in]p_ctrlControl block for the LevelX NOR framework instance.
[in]blockSpecifies which block to verify that it is erased.
Return values
SSP_SUCCESSLevelX flash block erase verification successful.
SSP_ERR_ASSERTIONp_ctrl or lower level driver is NULL.
SSP_ERR_NOT_OPENDriver not in OPEN state for verifying.
SSP_ERR_NOT_ERASEDThe block is not erased properly.
Returns
See Common Error Codes or lower level drivers for other possible return codes. This function calls

Validate the parameters

Check whether the driver is in OPEN state

Loop to check if the block is erased.

Check whether the driver read is success or not

Iterate over buffer and validate

Is this word erased?

◆ SF_EL_LX_NOR_Close()

ssp_err_t SF_EL_LX_NOR_Close ( sf_el_lx_nor_instance_ctrl_t *const  p_ctrl)

LevelX NOR driver close service.

This is responsible for closing the driver properly.

Parameters
[in]p_ctrlControl block for the LevelX NOR framework instance.
Return values
SSP_SUCCESSLevelX flash is available and is now open for read, write, and control access.
SSP_ERR_ASSERTIONp_ctrl is NULL.
SSP_ERR_NOT_OPENDriver not in OPEN state for closing.
Returns
See Common Error Codes or lower level drivers for other possible return codes. This function calls

Validate the parameters

Check whether the driver is in OPEN state

Close underlying API

Reset OPEN state

◆ SF_EL_LX_NOR_Open()

ssp_err_t SF_EL_LX_NOR_Open ( sf_el_lx_nor_instance_ctrl_t *const  p_ctrl,
sf_el_lx_nor_instance_cfg_t const *const  p_cfg 
)

Initializes LevelX NOR frame work read/write and control.

Name of module used by error logger macro Calls lower level driver initialization function.

Parameters
[in,out]p_ctrlControl block for the LevelX NOR framework instance.
[in,out]p_cfgLevelX NOR driver instance.
Return values
SSP_SUCCESSLevelX NOR driver is successfully opened.
SSP_ERR_ASSERTIONp_ctrl or p_cfg is NULL.
SSP_ERR_ALREADY_OPENDriver is already in OPEN state.
SSP_ERR_INVALID_ARGUMENTp_memory_settings structure configured to invalid values.
Returns
See Common Error Codes or lower level drivers for other possible return codes. This function calls

Validate the parameters

Check whether instance is already open

Update the instance control block

Open the underlying memory instance

Get the underlying NOR flash info

If unable to get NOR flash info, close lower layer driver

Update memory region info

Setup the base address of the flash memory.

Setup geometry of the flash.

Setup the base address of the flash memory.

Setup geometry of the flash.

Mark control block open so subsequent calls know the device is open.

◆ SF_EL_LX_NOR_Read()

ssp_err_t SF_EL_LX_NOR_Read ( sf_el_lx_nor_instance_ctrl_t *const  p_ctrl,
ULONG *const  p_flash,
ULONG *const  p_dest,
ULONG  word_count 
)

LevelX NOR driver "read sector" service.

This is responsible for reading a specific sector in a specific block of the NOR flash. All error checking and correcting logic is the responsibility of the this service.

Parameters
[in]p_ctrlControl block for the LevelX NOR framework instance.
[in]p_flashSpecifies the address of a logical sector within a NOR flash block of memory.
[in,out]p_destSpecifies where to place the sector contents.
[in]word_countSpecifies how many 32-bit words to read.
Return values
SSP_SUCCESSLevelX NOR flash sector read successful.
SSP_ERR_ASSERTIONp_ctrl, p_flash or p_dest is NULL.
SSP_ERR_NOT_OPENDriver not in OPEN state for reading.
SSP_ERR_INVALID_ARGUMENTRequested range can't fit in the flash address range.
Returns
See Common Error Codes or lower level drivers for other possible return codes. This function calls

Validate the parameters

Check whether the driver is in OPEN state

Read from underlying API

◆ SF_EL_LX_NOR_Write()

ssp_err_t SF_EL_LX_NOR_Write ( sf_el_lx_nor_instance_ctrl_t *const  p_ctrl,
ULONG *const  p_flash,
ULONG *const  p_src,
ULONG  word_count 
)

LevelX NOR driver "write sector" service.

This is responsible for writing a specific sector into a block of the NOR flash. All error checking is the responsibility of the this service.

Parameters
[in]p_ctrlControl block for the LevelX NOR framework instance.
[in,out]p_flashSpecifies the address of a logical sector within a NOR flash block of memory.
[in]p_srcSpecifies the source of the write.
[in]word_countSpecifies how many 32-bit words to write.
Return values
SSP_SUCCESSLevelX NOR flash sector write successful.
SSP_ERR_ASSERTIONp_ctrl, p_flash or p_src is NULL.
SSP_ERR_NOT_OPENDriver not in OPEN state for writing.
SSP_ERR_INVALID_ARGUMENTRequested range can't fit in the flash address range.
Returns
See Common Error Codes or lower level drivers for other possible return codes. This function calls

Validate the parameters

Check whether the driver is in OPEN state

Write to underlying API