![]() |
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... | |
LevelX NOR driver implementation.
| #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
| #define SF_EL_LX_NOR_CODE_VERSION_MAJOR (2U) |
Version of code that implements the API defined in this file
| enum sf_el_lx_nor_event_t |
| 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.
| [in] | p_ctrl | Control block for the LevelX NOR framework instance. |
| [in] | block | Specifies which NOR block to erase. |
| [in] | erase_count | Provided for diagnostic purposes(currently unused). |
| SSP_SUCCESS | LevelX NOR flash block erase successful. |
| SSP_ERR_ASSERTION | p_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | Driver not in OPEN state for erasing. |
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
| 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.
| [in] | p_ctrl | Control block for the LevelX NOR framework instance. |
| [in] | block | Specifies which block to verify that it is erased. |
| SSP_SUCCESS | LevelX flash block erase verification successful. |
| SSP_ERR_ASSERTION | p_ctrl or lower level driver is NULL. |
| SSP_ERR_NOT_OPEN | Driver not in OPEN state for verifying. |
| SSP_ERR_NOT_ERASED | The block is not erased properly. |
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?
| 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.
| [in] | p_ctrl | Control block for the LevelX NOR framework instance. |
| SSP_SUCCESS | LevelX flash is available and is now open for read, write, and control access. |
| SSP_ERR_ASSERTION | p_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | Driver not in OPEN state for closing. |
Validate the parameters
Check whether the driver is in OPEN state
Close underlying API
Reset OPEN state
| 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.
| [in,out] | p_ctrl | Control block for the LevelX NOR framework instance. |
| [in,out] | p_cfg | LevelX NOR driver instance. |
| SSP_SUCCESS | LevelX NOR driver is successfully opened. |
| SSP_ERR_ASSERTION | p_ctrl or p_cfg is NULL. |
| SSP_ERR_ALREADY_OPEN | Driver is already in OPEN state. |
| SSP_ERR_INVALID_ARGUMENT | p_memory_settings structure configured to invalid values. |
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.
| 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.
| [in] | p_ctrl | Control block for the LevelX NOR framework instance. |
| [in] | p_flash | Specifies the address of a logical sector within a NOR flash block of memory. |
| [in,out] | p_dest | Specifies where to place the sector contents. |
| [in] | word_count | Specifies how many 32-bit words to read. |
| SSP_SUCCESS | LevelX NOR flash sector read successful. |
| SSP_ERR_ASSERTION | p_ctrl, p_flash or p_dest is NULL. |
| SSP_ERR_NOT_OPEN | Driver not in OPEN state for reading. |
| SSP_ERR_INVALID_ARGUMENT | Requested range can't fit in the flash address range. |
Validate the parameters
Check whether the driver is in OPEN state
Read from underlying API
| 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.
| [in] | p_ctrl | Control block for the LevelX NOR framework instance. |
| [in,out] | p_flash | Specifies the address of a logical sector within a NOR flash block of memory. |
| [in] | p_src | Specifies the source of the write. |
| [in] | word_count | Specifies how many 32-bit words to write. |
| SSP_SUCCESS | LevelX NOR flash sector write successful. |
| SSP_ERR_ASSERTION | p_ctrl, p_flash or p_src is NULL. |
| SSP_ERR_NOT_OPEN | Driver not in OPEN state for writing. |
| SSP_ERR_INVALID_ARGUMENT | Requested range can't fit in the flash address range. |
Validate the parameters
Check whether the driver is in OPEN state
Write to underlying API