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
 

Detailed Description

RTOS-integrated Block Media framework for QSPI driver.

Macro Definition Documentation

◆ SF_BLOCK_MEDIA_QSPI_ERROR_RETURN

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

◆ SF_QSPI_OPEN

#define SF_QSPI_OPEN   (0x51535049U)

"QSPI" in ASCII, used to identify general SF_BLOCK_MEDIA_QSPI control block

Function Documentation

◆ SF_BLOCK_MEDIA_QSPI_Close()

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.

Return values
SSP_SUCCESSSuccessful close.
SSP_ERR_ASSERTIONOne of the following parameters may be null: p_api_ctrl.
SSP_ERR_NOT_OPENBlock media QSPI Framework module is not yet initialized.
Returns
See Common Error Codes or HAL driver for other possible return codes or causes. This function calls

Delete RTOS services allocated during the open call.

◆ SF_BLOCK_MEDIA_QSPI_Control()

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.

Return values
SSP_SUCCESSCommand executed successfully.
SSP_ERR_ASSERTIONOne of the following parameters may be null: p_api_ctrl.
SSP_ERR_NOT_OPENBlock media QSPI Framework module is not yet initialized.
SSP_ERR_UNSUPPORTEDCommand not support.
Returns
See Common Error Codes or HAL driver for other possible return codes or causes. This function calls

Get the information of Flash

◆ SF_BLOCK_MEDIA_QSPI_Open()

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

Return values
SSP_SUCCESSBlock media for QSPI framework is successfully opened.
SSP_ERR_ASSERTIONOne of the following parameters may be null: p_api_ctrl, p_cfg or configuration for qspi.
SSP_ERR_IN_USEThe 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_INTERNALAn internal ThreadX error has occurred.
Returns
See Common Error Codes or HAL driver for other possible return codes or causes. This function calls

 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

◆ SF_BLOCK_MEDIA_QSPI_Read()

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.

Return values
SSP_SUCCESSQSPI data read successfully.
SSP_ERR_ASSERTIONp_api_ctrl or p_dest is NULL. Or block_count is zero.
SSP_ERR_NOT_OPENBlock media QSPI Framework module is not yet initialized.
SSP_ERR_IN_USEThe channel specified has already been opened. or the mutex may be unavailable for the the device. See HAL driver for other possible causes.
Returns
See Common Error Codes or HAL driver for other possible return codes or causes. This function calls

Obtain mutex before making HAL-level driver call.

Release mutex

◆ SF_BLOCK_MEDIA_QSPI_VersionGet()

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.

Return values
SSP_SUCCESSFunction executed successfully.
SSP_ERR_ASSERTIONNull Pointer.
Note
This function is reentrant.

◆ SF_BLOCK_MEDIA_QSPI_Write()

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.

Return values
SSP_SUCCESSFlash write finished successfully.
SSP_ERR_ASSERTIONp_api_ctrl or p_src is NULL. Or block_count is zero.
SSP_ERR_NOT_OPENBlock media QSPI Framework module is not yet initialized.
SSP_ERR_IN_USEThe 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_UNSUPPORTEDTotal number of programmable bytes is greater than total flash capacity
Returns
See Common Error Codes or HAL driver for other possible return codes or causes. This function calls

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

Variable Documentation

◆ g_sf_block_media_on_sf_block_media_qspi

const sf_block_media_api_t g_sf_block_media_on_sf_block_media_qspi
Initial value:

Block Media QSPI function pointers