![]() |
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) |
Shared Interface definition for FLASH
| ssp_err_t(* flash_api_t::accessWindowClear) (flash_ctrl_t *const p_ctrl) |
Clear any existing Code Flash access window for FLASH device.
| [in] | p_ctrl | Pointer to FLASH device control. |
| [in] | start_addr | Determines the Starting block for the Code Flash access window. |
| [in] | end_addr | Determines the Ending block for the Code Flash access window. |
| 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.
| [in] | p_ctrl | Pointer to FLASH device control. |
| [in] | start_addr | Determines the Starting block for the Code Flash access window. |
| [in] | end_addr | Determines the Ending block for the Code Flash access window. |
| 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.
| [in] | p_ctrl | Control for the FLASH device context. |
| [in] | address | The starting address of the Flash area to blank check. |
| [in] | num_bytes | Specifies the number of bytes that need to be checked. See the specific handler for details. |
| [out] | p_blank_check_result | Pointer 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. |
| ssp_err_t(* flash_api_t::close) (flash_ctrl_t *const p_ctrl) |
Close FLASH device.
| [in] | p_ctrl | Pointer to FLASH device control. |
| 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.
| [in] | p_ctrl | Control for the FLASH device. |
| [in] | address | The block containing this address is the first block erased. |
| [in] | num_blocks | Specifies the number of blocks to be erased, the starting block determined by the block_erase_address. |
| 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
| [in] | p_ctrl | Pointer to FLASH device control. |
| [in] | p_id_bytes | Ponter to the ID Code to be written. |
| [in] | mode | Mode used for checking the ID code. |
| ssp_err_t(* flash_api_t::infoGet) (flash_ctrl_t *const p_ctrl, flash_info_t *const p_info) |
Close FLASH device.
| [in] | p_ctrl | Pointer to FLASH device control. |
| [out] | p_info | Pointer to FLASH info structure. |
| ssp_err_t(* flash_api_t::open) (flash_ctrl_t *const p_ctrl, flash_cfg_t const *const p_cfg) |
Open FLASH device.
| [out] | p_ctrl | Pointer to FLASH device control. Must be declared by user. Value set here. |
| [in] | flash_cfg_t | Pointer to FLASH configuration structure. All elements of this structure must be set by the user. |
| 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.
| [in] | p_ctrl | Control for the FLASH device context. |
| [in] | p_dest_address | Pointer to caller's destination buffer used to hold the data read from Flash. |
| [in] | flash_address | Code Flash or Data Flash starting address to read from. |
| [in] | num_bytes | The number of bytes to read. |
| ssp_err_t(* flash_api_t::reset) (flash_ctrl_t *const p_ctrl) |
Reset function for FLASH device.
| [in] | p_ctrl | Pointer to FLASH device control. |
| 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.
| [in] | p_ctrl | Pointer to FLASH device control. |
| [in] | swap_type | FLASH_STARTUP_AREA_BLOCK0, FLASH_STARTUP_AREA_BLOCK1 or FLASH_STARTUP_AREA_BTFLG. |
| [in] | is_temporary | True 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.
| ssp_err_t(* flash_api_t::statusGet) (flash_ctrl_t *const p_ctrl) |
Get Status for FLASH device.
| [in] | p_ctrl | Pointer to FLASH device control. |
| ssp_err_t(* flash_api_t::updateFlashClockFreq) (flash_ctrl_t *const p_ctrl) |
Update Flash clock frequency (FCLK) and recalculate timeout values
| [in] | p_ctrl | Pointer to FLASH device control. |
| ssp_err_t(* flash_api_t::versionGet) (ssp_version_t *p_version) |
Get Flash driver version.
| [out] | p_version | Returns version. |
| 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.
| [in] | p_ctrl | Control for the FLASH device context. |
| [in] | src_address | Address of the buffer containing the data to write to Flash. |
| [in] | flash_address | Code Flash or Data Flash address to write. The address must be on a programming line boundary. |
| [in] | num_bytes | The 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. |