![]() |
Synergy Software Package User's Manual
|
RTOS-integrated Block Media framework for QSPI driver. More...
Data Structures | |
| struct | sf_block_media_qspi_instance_ctrl_t |
Macros | |
| #define | SF_QSPI_OPEN (0x51535049U) |
| #define | SF_BLOCK_MEDIA_QSPI_ERROR_RETURN(a, err) SSP_ERROR_RETURN((a), (err), &g_module_name[0], &g_block_media_qspi_version) |
Functions | |
| ssp_err_t | SF_BLOCK_MEDIA_QSPI_Open (sf_block_media_ctrl_t *const p_api_ctrl, sf_block_media_cfg_t const *const p_cfg) |
| Open Block Media QSPI flash device for read/write and control. Parameter checking and Acquires mutex, then handles driver initialization at the HAL QSPI layer and marking the open flag in control block. More... | |
| ssp_err_t | SF_BLOCK_MEDIA_QSPI_Read (sf_block_media_ctrl_t *const p_api_ctrl, uint8_t *const p_dest, uint32_t const start_block, uint32_t const block_count) |
| Read requested data from Block Media QSPI Flash through QSPI channel. More... | |
| ssp_err_t | SF_BLOCK_MEDIA_QSPI_Write (sf_block_media_ctrl_t *const p_api_ctrl, uint8_t const *const p_src, uint32_t const start_block, uint32_t const block_count) |
| Program requested data content to the Block Media QSPI flash memory. More... | |
| ssp_err_t | SF_BLOCK_MEDIA_QSPI_Control (sf_block_media_ctrl_t *const p_api_ctrl, ssp_command_t const command, void *p_data) |
| Send control commands to and receive status of flash. More... | |
| ssp_err_t | SF_BLOCK_MEDIA_QSPI_Close (sf_block_media_ctrl_t *const p_api_ctrl) |
| Close functionality will delete the resources which is initialized in open call. More... | |
| ssp_err_t | SF_BLOCK_MEDIA_QSPI_VersionGet (ssp_version_t *const p_version) |
| Get the firmware and API version of Block Media QSPI Framework. More... | |
Variables | |
| const sf_block_media_api_t | g_sf_block_media_on_sf_block_media_qspi |
RTOS-integrated Block Media framework for QSPI driver.
| #define SF_BLOCK_MEDIA_QSPI_ERROR_RETURN | ( | a, | |
| err | |||
| ) | SSP_ERROR_RETURN((a), (err), &g_module_name[0], &g_block_media_qspi_version) |
Macro for error logger.
| #define SF_QSPI_OPEN (0x51535049U) |
"QSPI" in ASCII, used to identify general SF_BLOCK_MEDIA_QSPI control block
| ssp_err_t SF_BLOCK_MEDIA_QSPI_Close | ( | sf_block_media_ctrl_t *const | p_api_ctrl | ) |
Close functionality will delete the resources which is initialized in open call.
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | One of the following parameters may be null: p_api_ctrl. |
| SSP_ERR_NOT_OPEN | Block media QSPI Framework module is not yet initialized. |
Delete RTOS services allocated during the open call.
| ssp_err_t SF_BLOCK_MEDIA_QSPI_Control | ( | sf_block_media_ctrl_t *const | p_api_ctrl, |
| ssp_command_t const | command, | ||
| void * | p_data | ||
| ) |
Send control commands to and receive status of flash.
| SSP_SUCCESS | Command executed successfully. |
| SSP_ERR_ASSERTION | One of the following parameters may be null: p_api_ctrl. |
| SSP_ERR_NOT_OPEN | Block media QSPI Framework module is not yet initialized. |
| SSP_ERR_UNSUPPORTED | Command not support. |
Get the information of Flash
| ssp_err_t SF_BLOCK_MEDIA_QSPI_Open | ( | sf_block_media_ctrl_t *const | p_api_ctrl, |
| sf_block_media_cfg_t const *const | p_cfg | ||
| ) |
Open Block Media QSPI flash device for read/write and control. Parameter checking and Acquires mutex, then handles driver initialization at the HAL QSPI layer and marking the open flag in control block.
Name of module used by error logger macro
| SSP_SUCCESS | Block media for QSPI framework is successfully opened. |
| SSP_ERR_ASSERTION | One of the following parameters may be null: p_api_ctrl, p_cfg or configuration for qspi. |
| SSP_ERR_IN_USE | The channel specified has already been opened. or the mutex may be unavailable for the the device. See HAL driver for other possible causes. |
| SSP_ERR_INTERNAL | An internal ThreadX error has occurred. |
Create a mutex to protect access to the control structure and the lower level hardware.
Calling low level driver
On success populate the control structure
Selecting smallest block erasable by underlying QSPI flash
| ssp_err_t SF_BLOCK_MEDIA_QSPI_Read | ( | sf_block_media_ctrl_t *const | p_api_ctrl, |
| uint8_t *const | p_dest, | ||
| uint32_t const | start_block, | ||
| uint32_t const | block_count | ||
| ) |
Read requested data from Block Media QSPI Flash through QSPI channel.
| SSP_SUCCESS | QSPI data read successfully. |
| SSP_ERR_ASSERTION | p_api_ctrl or p_dest is NULL. Or block_count is zero. |
| SSP_ERR_NOT_OPEN | Block media QSPI Framework module is not yet initialized. |
| SSP_ERR_IN_USE | The channel specified has already been opened. or the mutex may be unavailable for the the device. See HAL driver for other possible causes. |
Obtain mutex before making HAL-level driver call.
Release mutex
| ssp_err_t SF_BLOCK_MEDIA_QSPI_VersionGet | ( | ssp_version_t *const | p_version | ) |
Get the firmware and API version of Block Media QSPI Framework.
| SSP_SUCCESS | Function executed successfully. |
| SSP_ERR_ASSERTION | Null Pointer. |
| ssp_err_t SF_BLOCK_MEDIA_QSPI_Write | ( | sf_block_media_ctrl_t *const | p_api_ctrl, |
| uint8_t const *const | p_src, | ||
| uint32_t const | start_block, | ||
| uint32_t const | block_count | ||
| ) |
Program requested data content to the Block Media QSPI flash memory.
| SSP_SUCCESS | Flash write finished successfully. |
| SSP_ERR_ASSERTION | p_api_ctrl or p_src is NULL. Or block_count is zero. |
| SSP_ERR_NOT_OPEN | Block media QSPI Framework module is not yet initialized. |
| SSP_ERR_IN_USE | The channel specified has already been opened. or the mutex may be unavailable for the the device. See HAL driver for other possible causes. |
| SSP_ERR_UNSUPPORTED | Total number of programmable bytes is greater than total flash capacity |
Obtain mutex before making HAL-level driver call.
Get the information of Flash
Calculate the address of flash
Check if total number of bytes programmable into flash is greater than total flash capacity
Calculate the number of iteration required to complete write operation
Write data into the block media QSPI flash
Release mutex
| const sf_block_media_api_t g_sf_block_media_on_sf_block_media_qspi |
Block Media QSPI function pointers