Synergy Software Package User's Manual

RTOS-integrated Block Media framework for SDMMC driver. More...

Data Structures

struct  sf_block_media_sdmmc_instance_ctrl_t
 

Functions

ssp_err_t SF_Block_Media_SDMMC_Open (sf_block_media_ctrl_t *const p_api_ctrl, sf_block_media_cfg_t const *const p_cfg)
 Open device for read/write and control. More...
 
ssp_err_t SF_Block_Media_SDMMC_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 data from SD/MMC. More...
 
ssp_err_t SF_Block_Media_SDMMC_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)
 Write data to SDMMC channel. More...
 
ssp_err_t SF_Block_Media_SDMMC_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 SD/MMC port. More...
 
ssp_err_t SF_Block_Media_SDMMC_Close (sf_block_media_ctrl_t *const p_api_ctrl)
 Close open device port. More...
 
ssp_err_t SF_Block_Media_SDMMC_VersionGet (ssp_version_t *const p_version)
 Get version of Block Media SD/MMC driver. More...
 

Detailed Description

RTOS-integrated Block Media framework for SDMMC driver.

Function Documentation

◆ SF_Block_Media_SDMMC_Close()

ssp_err_t SF_Block_Media_SDMMC_Close ( sf_block_media_ctrl_t *const  p_api_ctrl)

Close open device port.

Close an open SD/MMC device port.

Return values
SSP_SUCCESSSuccessful close.
SSP_ERR_ASSERTIONp_ctrl or p_sdmmc is NULL.
SSP_ERR_NOT_OPENThe channel is not opened.
Note
This function is reentrant for different channels. It is not reentrant for the same channel.

Mark control block as unused so it can be reconfigured.

◆ SF_Block_Media_SDMMC_Control()

ssp_err_t SF_Block_Media_SDMMC_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 SD/MMC port.

Send control commands to the SD/MMC port and receive the status of the SD/MMC port.

Return values
SSP_SUCCESSCommand executed successfully.
SSP_ERR_ASSERTIONp_ctrl or p_sdmmc or p_data is Null.
SSP_ERR_NOT_OPENThe channel is not opened.
Returns
See Common Error Codes or lower level drivers for other possible return codes. This function calls:
Note
This function is reentrant for different channels. It is not reentrant for the same channel.

◆ SF_Block_Media_SDMMC_Open()

ssp_err_t SF_Block_Media_SDMMC_Open ( sf_block_media_ctrl_t *const  p_api_ctrl,
sf_block_media_cfg_t const *const  p_cfg 
)

Open device for read/write and control.

Open an SD or MMC device port for read/write and control. This function initializes the SDMMC driver and hardware the first time it is called out of reset.

Return values
SSP_SUCCESSPort is available and is now open for read, write, and control access.
SSP_ERR_ASSERTIONp_ctrl, p_cfg, p_block_media_cfg or p_sdmmc is NULL.
SSP_ERR_INTERNALOS service call fails.
SSP_ERR_IN_USEThe channel specified has already been opened. No configurations were changed. Call the associated Close function or use associated Control commands to reconfigure the channel.
Returns
See Common Error Codes or lower level drivers for other possible return codes. This function calls:
Note
This function is reentrant for different channels. It is not reentrant for the same channel.

Create SDMMC event flag and put it into context

Mark the stream as open by initializing "BMSO" in its ASCII equivalent.

Cleanup before logging the error

◆ SF_Block_Media_SDMMC_Read()

ssp_err_t SF_Block_Media_SDMMC_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 data from SD/MMC.

Read data from an SD or MMC device port.

Return values
SSP_SUCCESSData read successfully.
SSP_ERR_ASSERTIONp_ctrl, p_sdmmc or p_dest is NULL.
SSP_ERR_NOT_OPENThe channel is not opened.
SSP_ERR_INTERNALOS service call fails.
SSP_ERR_READ_FAILEDData read failed.
Returns
See Common Error Codes or lower level drivers for other possible return codes. This function calls:
Note
This function is reentrant for different channels. It is not reentrant for the same channel.

Wait until read operation is completed. Event is signaled in event flag object.

◆ SF_Block_Media_SDMMC_VersionGet()

ssp_err_t SF_Block_Media_SDMMC_VersionGet ( ssp_version_t *const  p_version)

Get version of Block Media SD/MMC driver.

Return the version of the firmware and API.

Return values
SSP_ERR_ASSERTIONp_version is Pointer.
SSP_SUCCESSversion read successfully.
Note
This function is reentrant.

◆ SF_Block_Media_SDMMC_Write()

ssp_err_t SF_Block_Media_SDMMC_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 
)

Write data to SDMMC channel.

Return values
SSP_SUCCESSCard write finished successfully.
SSP_ERR_ASSERTIONp_ctrl, p_sdmmc or p_src is NULL.
SSP_ERR_NOT_OPENThe channel is not opened.
SSP_ERR_INTERNALOS service call fails.
SSP_ERR_WRITE_FAILEDData write failed.
Returns
See Common Error Codes or lower level drivers for other possible return codes. This function calls:
Note
This function is reentrant for different channels.

Wait until write operation is completed. Event is signaled in event flag object.