Synergy Software Package User's Manual

#include <r_flash_api.h>

Data Fields

ssp_err_t(* open )(flash_ctrl_t *const p_ctrl, flash_cfg_t const *const p_cfg)
 
ssp_err_t(* write )(flash_ctrl_t *const p_ctrl, uint32_t const src_address, uint32_t const flash_address, uint32_t const num_bytes)
 
ssp_err_t(* read )(flash_ctrl_t *const p_ctrl, uint8_t *const p_dest_address, uint32_t const flash_address, uint32_t const num_bytes)
 
ssp_err_t(* erase )(flash_ctrl_t *const p_ctrl, uint32_t const address, uint32_t const num_blocks)
 
ssp_err_t(* blankCheck )(flash_ctrl_t *const p_ctrl, uint32_t const address, uint32_t const num_bytes, flash_result_t *const p_blank_check_result)
 
ssp_err_t(* infoGet )(flash_ctrl_t *const p_ctrl, flash_info_t *const p_info)
 
ssp_err_t(* close )(flash_ctrl_t *const p_ctrl)
 
ssp_err_t(* statusGet )(flash_ctrl_t *const p_ctrl)
 
ssp_err_t(* accessWindowSet )(flash_ctrl_t *const p_ctrl, uint32_t const start_addr, uint32_t const end_addr)
 
ssp_err_t(* accessWindowClear )(flash_ctrl_t *const p_ctrl)
 
ssp_err_t(* idCodeSet )(flash_ctrl_t *const p_ctrl, uint8_t const *const p_id_bytes, flash_id_code_mode_t mode)
 
ssp_err_t(* reset )(flash_ctrl_t *const p_ctrl)
 
ssp_err_t(* updateFlashClockFreq )(flash_ctrl_t *const p_ctrl)
 
ssp_err_t(* startupAreaSelect )(flash_ctrl_t *const p_ctrl, flash_startup_area_swap_t swap_type, bool is_temporary)
 
ssp_err_t(* versionGet )(ssp_version_t *p_version)
 

Detailed Description

Shared Interface definition for FLASH

Field Documentation

◆ accessWindowClear

ssp_err_t(* flash_api_t::accessWindowClear) (flash_ctrl_t *const p_ctrl)

Clear any existing Code Flash access window for FLASH device.

Implemented as
Parameters
[in]p_ctrlPointer to FLASH device control.
[in]start_addrDetermines the Starting block for the Code Flash access window.
[in]end_addrDetermines the Ending block for the Code Flash access window.

◆ accessWindowSet

ssp_err_t(* flash_api_t::accessWindowSet) (flash_ctrl_t *const p_ctrl, uint32_t const start_addr, uint32_t const end_addr)

Set Access Window for FLASH device.

Implemented as
Parameters
[in]p_ctrlPointer to FLASH device control.
[in]start_addrDetermines the Starting block for the Code Flash access window.
[in]end_addrDetermines the Ending block for the Code Flash access window.

◆ blankCheck

ssp_err_t(* flash_api_t::blankCheck) (flash_ctrl_t *const p_ctrl, uint32_t const address, uint32_t const num_bytes, flash_result_t *const p_blank_check_result)

Blank check FLASH device.

Implemented as
Parameters
[in]p_ctrlControl for the FLASH device context.
[in]addressThe starting address of the Flash area to blank check.
[in]num_bytesSpecifies the number of bytes that need to be checked. See the specific handler for details.
[out]p_blank_check_resultPointer that will be populated by the API with the results of the blank check operation in non-BGO (blocking) mode. In this case the blank check operation completes here and the result is returned. In Data Flash BGO mode the blank check operation is only started here and the result obtained later when the supplied callback routine is called. In this case FLASH_RESULT_BGO_ACTIVE will be returned in p_blank_check_result.

◆ close

ssp_err_t(* flash_api_t::close) (flash_ctrl_t *const p_ctrl)

Close FLASH device.

Implemented as
Parameters
[in]p_ctrlPointer to FLASH device control.

◆ erase

ssp_err_t(* flash_api_t::erase) (flash_ctrl_t *const p_ctrl, uint32_t const address, uint32_t const num_blocks)

Erase FLASH device.

Implemented as
R_FLASH_LP_Erase() R_FLASH_HP_Erase()
Parameters
[in]p_ctrlControl for the FLASH device.
[in]addressThe block containing this address is the first block erased.
[in]num_blocksSpecifies the number of blocks to be erased, the starting block determined by the block_erase_address.

◆ idCodeSet

ssp_err_t(* flash_api_t::idCodeSet) (flash_ctrl_t *const p_ctrl, uint8_t const *const p_id_bytes, flash_id_code_mode_t mode)

Set ID Code for FLASH device. Setting the ID code can restrict access to the device. The ID code will be required to connect to the device. Bits 126 and 127 are set based on the mode. e.g. uint8_t id_bytes[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0x00}; with mode FLASH_ID_CODE_MODE_LOCKED_WITH_ALL_ERASE_SUPPORT will result in an ID code of 00112233445566778899aabbccddeec0 and with mode FLASH_ID_CODE_MODE_LOCKED will result in an ID code of 00112233445566778899aabbccddee80

Implemented as
Parameters
[in]p_ctrlPointer to FLASH device control.
[in]p_id_bytesPonter to the ID Code to be written.
[in]modeMode used for checking the ID code.

◆ infoGet

ssp_err_t(* flash_api_t::infoGet) (flash_ctrl_t *const p_ctrl, flash_info_t *const p_info)

Close FLASH device.

Implemented as
Parameters
[in]p_ctrlPointer to FLASH device control.
[out]p_infoPointer to FLASH info structure.

◆ open

ssp_err_t(* flash_api_t::open) (flash_ctrl_t *const p_ctrl, flash_cfg_t const *const p_cfg)

Open FLASH device.

Implemented as
Parameters
[out]p_ctrlPointer to FLASH device control. Must be declared by user. Value set here.
[in]flash_cfg_tPointer to FLASH configuration structure. All elements of this structure must be set by the user.

◆ read

ssp_err_t(* flash_api_t::read) (flash_ctrl_t *const p_ctrl, uint8_t *const p_dest_address, uint32_t const flash_address, uint32_t const num_bytes)

Read FLASH device.

Implemented as
Parameters
[in]p_ctrlControl for the FLASH device context.
[in]p_dest_addressPointer to caller's destination buffer used to hold the data read from Flash.
[in]flash_addressCode Flash or Data Flash starting address to read from.
[in]num_bytesThe number of bytes to read.

◆ reset

ssp_err_t(* flash_api_t::reset) (flash_ctrl_t *const p_ctrl)

Reset function for FLASH device.

Implemented as
Parameters
[in]p_ctrlPointer to FLASH device control.

◆ startupAreaSelect

ssp_err_t(* flash_api_t::startupAreaSelect) (flash_ctrl_t *const p_ctrl, flash_startup_area_swap_t swap_type, bool is_temporary)

Select which block - Default (Block 0) or Alternate (Block 1) is used as the start-up area block.

Implemented as
Parameters
[in]p_ctrlPointer to FLASH device control.
[in]swap_typeFLASH_STARTUP_AREA_BLOCK0, FLASH_STARTUP_AREA_BLOCK1 or FLASH_STARTUP_AREA_BTFLG.
[in]is_temporaryTrue or false. See table below.

swap_type | is_temporary | Operation FLASH_STARTUP_AREA_BLOCK0: false On next reset Startup area will be Block 0.
FLASH_STARTUP_AREA_BLOCK0 | false | On next reset Startup area will be Block 0. Block 0.
FLASH_STARTUP_AREA_BLOCK1: false On next reset Startup area will be Block 1.
FLASH_STARTUP_AREA_BLOCK1 | true | Startup area is immediately, but temporarily switched to Block 1. Block 1.
FLASH_STARTUP_AREA_BTFLG | true | Startup area is immediately, but temporarily switched to... taken.
the Block determined by the Configuration BTFLG.

◆ statusGet

ssp_err_t(* flash_api_t::statusGet) (flash_ctrl_t *const p_ctrl)

Get Status for FLASH device.

Implemented as
Parameters
[in]p_ctrlPointer to FLASH device control.

◆ updateFlashClockFreq

ssp_err_t(* flash_api_t::updateFlashClockFreq) (flash_ctrl_t *const p_ctrl)

Update Flash clock frequency (FCLK) and recalculate timeout values

Implemented as
Parameters
[in]p_ctrlPointer to FLASH device control.

◆ versionGet

ssp_err_t(* flash_api_t::versionGet) (ssp_version_t *p_version)

Get Flash driver version.

Implemented as
Parameters
[out]p_versionReturns version.

◆ write

ssp_err_t(* flash_api_t::write) (flash_ctrl_t *const p_ctrl, uint32_t const src_address, uint32_t const flash_address, uint32_t const num_bytes)

Write FLASH device.

Implemented as
Parameters
[in]p_ctrlControl for the FLASH device context.
[in]src_addressAddress of the buffer containing the data to write to Flash.
[in]flash_addressCode Flash or Data Flash address to write. The address must be on a programming line boundary.
[in]num_bytesThe number of bytes to write. This number must be a multiple of the programming size. For Code Flash this is FLASH_MIN_PGM_SIZE_CF. For Data Flash this is FLASH_MIN_PGM_SIZE_DF.
Warning
Specifying a number that is not a multiple of the programming size will result in SF_FLASH_ERR_BYTES being returned and no data written.

The documentation for this struct was generated from the following file: