![]() |
Synergy Software Package User's Manual
|
RTOS-integrated Block Media framework for LEVELX driver. More...
Data Structures | |
| struct | sf_block_media_on_lx_nor_cfg_t |
| struct | sf_block_media_lx_nor_instance_ctrl_t |
Macros | |
| #define | SF_BLOCK_MEDIA_LX_NOR_ERROR_RETURN(a, err) SSP_ERROR_RETURN((a), (err), &g_module_name[0], &g_block_media_lx_nor_version) |
| #define | SF_BLOCK_MEDIA_LX_NOR_OPEN (0x424D4C4FU) |
Functions | |
| ssp_err_t | SF_BLOCK_MEDIA_LX_NOR_Open (sf_block_media_ctrl_t *const p_ctrl, sf_block_media_cfg_t const *const p_cfg) |
| Open device for read/write and control. More... | |
| ssp_err_t | SF_BLOCK_MEDIA_LX_NOR_Read (sf_block_media_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint32_t const start_sector, uint32_t const sector_count) |
| Read data from flash using LevelX. More... | |
| ssp_err_t | SF_BLOCK_MEDIA_LX_NOR_Write (sf_block_media_ctrl_t *const p_ctrl, uint8_t const *const p_src, uint32_t const start_sector, uint32_t const sector_count) |
| Write data to flash using LevelX. More... | |
| ssp_err_t | SF_BLOCK_MEDIA_LX_NOR_Control (sf_block_media_ctrl_t *const p_ctrl, ssp_command_t const command, void *p_data) |
| Send control commands to Block Media LevelX NOR driver. More... | |
| ssp_err_t | SF_BLOCK_MEDIA_LX_NOR_Close (sf_block_media_ctrl_t *const p_ctrl) |
| Close open Block Media LevelX NOR driver. More... | |
| ssp_err_t | SF_BLOCK_MEDIA_LX_NOR_VersionGet (ssp_version_t *const p_version) |
| Get version of Block Media LevelX driver. More... | |
Variables | |
| const sf_block_media_api_t | g_sf_block_media_on_sf_block_media_lx_nor |
RTOS-integrated Block Media framework for LEVELX driver.
| #define SF_BLOCK_MEDIA_LX_NOR_ERROR_RETURN | ( | a, | |
| err | |||
| ) | SSP_ERROR_RETURN((a), (err), &g_module_name[0], &g_block_media_lx_nor_version) |
Macro for error logger.
| #define SF_BLOCK_MEDIA_LX_NOR_OPEN (0x424D4C4FU) |
"BMLO" in ASCII, used to identify block media LevelX handle
| ssp_err_t SF_BLOCK_MEDIA_LX_NOR_Close | ( | sf_block_media_ctrl_t *const | p_ctrl | ) |
Close open Block Media LevelX NOR driver.
Close an open Block Media LevelX NOR driver.
| SSP_SUCCESS | Successfully closed. |
| SSP_ERR_ASSERTION | p_ctrl or p_nor_flash is NULL. |
| SSP_ERR_NOT_OPEN | The block media is not open. |
Validate the parameters
Check whether the instance is in open state
Close the LevelX NOR flash driver.
Close underlying NOR driver, if available
Mark control block close so subsequent calls know the device is close.
| ssp_err_t SF_BLOCK_MEDIA_LX_NOR_Control | ( | sf_block_media_ctrl_t *const | p_ctrl, |
| ssp_command_t const | command, | ||
| void * | p_data | ||
| ) |
Send control commands to Block Media LevelX NOR driver.
| SSP_SUCCESS | Command executed successfully. |
| SSP_ERR_ASSERTION | p_ctrl or p_data is Null. |
| SSP_ERR_NOT_OPEN | The block media is not open. |
| SSP_ERR_UNSUPPORTED | This module doesn't support requested command. |
| SSP_ERR_SECTOR_RELEASE_FAILED | Sector release command failed. |
Validate the parameters
Check whether the instance is in open state
Get the sector count
LevelX divides each NOR flash block into 512-byte logical sectors
It's not write protected
LevelX supports sector release
Release NOR flash sector.
| ssp_err_t SF_BLOCK_MEDIA_LX_NOR_Open | ( | sf_block_media_ctrl_t *const | p_ctrl, |
| sf_block_media_cfg_t const *const | p_cfg | ||
| ) |
Open device for read/write and control.
Open LevelX flash device for read/write and control. This function initializes the LevelX driver and hardware the first time it is called out of reset. The underlying flash needs to either be erased or already initialized with LevelX.
| SSP_SUCCESS | LevelX flash is available and is now open for read, write, and control access. |
| SSP_ERR_ASSERTION | p_ctrl, p_cfg or an input pointer is NULL. |
| SSP_ERR_MEDIA_OPEN_FAILED | LevelX NOR or the underlying flash failed to open. The underlying flash needs to either be erased or already initialized with LevelX. |
| SSP_ERR_ALREADY_OPEN | The block media LevelX NOR instance has already been opened. No configurations were changed. Call the associated Close function or use associated Control commands to reconfigure the instance. |
Validate the parameters
Check whether instance is already open
Update instance control block
Open underlying LevelX
Mark control block open so subsequent calls know the device is open.
| ssp_err_t SF_BLOCK_MEDIA_LX_NOR_Read | ( | sf_block_media_ctrl_t *const | p_ctrl, |
| uint8_t *const | p_dest, | ||
| uint32_t const | start_sector, | ||
| uint32_t const | sector_count | ||
| ) |
Read data from flash using LevelX.
| SSP_SUCCESS | Data read successfully. |
| SSP_ERR_ASSERTION | p_ctrl or p_dest is NULL. |
| SSP_ERR_NOT_OPEN | The block media is not open. |
| SSP_ERR_READ_FAILED | Data read failed. |
Validate the parameters
Check whether the instance is in open state
Loop to read sectors from flash.
Read a sector from NOR flash.
| ssp_err_t SF_BLOCK_MEDIA_LX_NOR_VersionGet | ( | ssp_version_t *const | p_version | ) |
Get version of Block Media LevelX driver.
Return the version of the firmware and API.
| SSP_ERR_ASSERTION | p_version is Pointer. |
| SSP_SUCCESS | version read successfully. |
Validate the parameters
| ssp_err_t SF_BLOCK_MEDIA_LX_NOR_Write | ( | sf_block_media_ctrl_t *const | p_ctrl, |
| uint8_t const *const | p_src, | ||
| uint32_t const | start_sector, | ||
| uint32_t const | sector_count | ||
| ) |
Write data to flash using LevelX.
| SSP_SUCCESS | Write finished successfully. |
| SSP_ERR_ASSERTION | p_ctrl or p_src is NULL. |
| SSP_ERR_NOT_OPEN | The block media is not open. |
| SSP_ERR_WRITE_FAILED | Data write failed. |
Validate the parameters
Check whether the instance is in open state
Loop to write sectors into flash.
Write a sector into NOR flash.
| const sf_block_media_api_t g_sf_block_media_on_sf_block_media_lx_nor |
Block Media LevelX function pointers