38#ifndef _FSL_FTFX_FLEXNVM_H_
39#define _FSL_FTFX_FLEXNVM_H_
56#define FSL_FLEXNVM_DRIVER_VERSION (MAKE_VERSION(3, 0, 0))
88#if defined(__cplusplus)
143 uint32_t lengthInBytes,
178#if defined(FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD) && FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD
215 uint32_t lengthInBytes);
242#if defined(FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD) && FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD
246 uint32_t lengthInBytes);
268 uint32_t eepromDataSizeCode,
269 uint32_t flexnvmPartitionCode);
301#if defined(FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD) && FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD
305 uint32_t lengthInBytes,
341 uint32_t lengthInBytes,
392 uint32_t lengthInBytes,
393 const uint8_t *expectedData,
395 uint32_t *failedAddress,
396 uint32_t *failedData);
458#if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD
586#if defined(__cplusplus)
static constexpr persistent_config_s * config
enum _ftfx_read_resource_opt ftfx_read_resource_opt_t
Enumeration for the two possible options of flash read resource command.
enum _ftfx_margin_value ftfx_margin_value_t
Enumeration for supported FTFx margin levels.
enum _ftfx_flexram_function_option ftfx_flexram_func_opt_t
Enumeration for the two possilbe options of set FlexRAM function command.
enum _ftfx_security_state ftfx_security_state_t
Enumeration for the three possible FTFx security states.
enum _ftfx_partition_flexram_load_option ftfx_partition_flexram_load_opt_t
Enumeration for the FlexRAM load during reset option.
status_t FLEXNVM_EraseAllUnsecure(flexnvm_config_t *config, uint32_t key)
Erases the entire flexnvm, including protected sectors.
status_t FLEXNVM_SecurityBypass(flexnvm_config_t *config, const uint8_t *backdoorKey)
Allows users to bypass security with a backdoor key.
status_t FLEXNVM_DflashSetProtection(flexnvm_config_t *config, uint8_t protectStatus)
Sets the DFlash protection to the intended protection status.
enum _flexnvm_property_tag flexnvm_property_tag_t
Enumeration for various flexnvm properties.
status_t FLEXNVM_DflashVerifyProgram(flexnvm_config_t *config, uint32_t start, uint32_t lengthInBytes, const uint8_t *expectedData, ftfx_margin_value_t margin, uint32_t *failedAddress, uint32_t *failedData)
Verifies programming of the desired flash area at a specified margin level.
status_t FLEXNVM_EepromWrite(flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes)
Programs the EEPROM with data at locations passed in through parameters.
status_t FLEXNVM_VerifyEraseAll(flexnvm_config_t *config, ftfx_margin_value_t margin)
Verifies erasure of the entire flash at a specified margin level.
_flexnvm_property_tag
Enumeration for various flexnvm properties.
status_t FLEXNVM_GetSecurityState(flexnvm_config_t *config, ftfx_security_state_t *state)
Returns the security state via the pointer passed into the function.
status_t FLEXNVM_DflashErase(flexnvm_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key)
Erases the Dflash sectors encompassed by parameters passed into function.
status_t FLEXNVM_EepromSetProtection(flexnvm_config_t *config, uint8_t protectStatus)
Sets the EEPROM protection to the intended protection status.
status_t FLEXNVM_DflashProgram(flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes)
Programs flash with data at locations passed in through parameters.
status_t FLEXNVM_EraseAll(flexnvm_config_t *config, uint32_t key)
Erases entire flexnvm.
status_t FLEXNVM_DflashProgramSection(flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes)
Programs flash with data at locations passed in through parameters via the Program Section command.
status_t FLEXNVM_ProgramPartition(flexnvm_config_t *config, ftfx_partition_flexram_load_opt_t option, uint32_t eepromDataSizeCode, uint32_t flexnvmPartitionCode)
Prepares the FlexNVM block for use as data flash, EEPROM backup, or a combination of both and initial...
struct _flexnvm_config flexnvm_config_t
Flexnvm driver state information.
status_t FLEXNVM_Init(flexnvm_config_t *config)
Initializes the global flash properties structure members.
status_t FLEXNVM_ReadResource(flexnvm_config_t *config, uint32_t start, uint8_t *dst, uint32_t lengthInBytes, ftfx_read_resource_opt_t option)
Reads the resource with data at locations passed in through parameters.
status_t FLEXNVM_GetProperty(flexnvm_config_t *config, flexnvm_property_tag_t whichProperty, uint32_t *value)
Returns the desired flexnvm property.
status_t FLEXNVM_DflashVerifyErase(flexnvm_config_t *config, uint32_t start, uint32_t lengthInBytes, ftfx_margin_value_t margin)
Verifies an erasure of the desired flash area at a specified margin level.
status_t FLEXNVM_EepromGetProtection(flexnvm_config_t *config, uint8_t *protectStatus)
Gets the EEPROM protection status.
status_t FLEXNVM_DflashGetProtection(flexnvm_config_t *config, uint8_t *protectStatus)
Gets the DFlash protection status.
status_t FLEXNVM_SetFlexramFunction(flexnvm_config_t *config, ftfx_flexram_func_opt_t option)
Sets the FlexRAM function command.
@ kFLEXNVM_PropertyDflashBlockSize
@ kFLEXNVM_PropertyDflashBlockCount
@ kFLEXNVM_PropertyEepromTotalSize
@ kFLEXNVM_PropertyFlexRamBlockBaseAddr
@ kFLEXNVM_PropertyDflashSectorSize
@ kFLEXNVM_PropertyFlexRamTotalSize
@ kFLEXNVM_PropertyDflashTotalSize
@ kFLEXNVM_PropertyDflashBlockBaseAddr
int32_t status_t
Type used for all status and error return values.
static status_t protectStatus
state("state", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1871, 1.0, -1.0, -1.0, "")
Flexnvm driver state information.
Flash driver state information.