123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592 |
- typedef enum _flexnvm_property_tag
- {
- kFLEXNVM_PropertyDflashSectorSize = 0x00U,
- kFLEXNVM_PropertyDflashTotalSize = 0x01U,
- kFLEXNVM_PropertyDflashBlockSize = 0x02U,
- kFLEXNVM_PropertyDflashBlockCount = 0x03U,
- kFLEXNVM_PropertyDflashBlockBaseAddr = 0x04U,
- kFLEXNVM_PropertyFlexRamBlockBaseAddr = 0x05U,
- kFLEXNVM_PropertyFlexRamTotalSize = 0x06U,
- kFLEXNVM_PropertyEepromTotalSize = 0x07U,
- } flexnvm_property_tag_t;
- typedef struct _flexnvm_config
- {
- ftfx_config_t ftfxConfig;
- } flexnvm_config_t;
- extern "C" {
- status_t FLEXNVM_Init(flexnvm_config_t *config);
- status_t FLEXNVM_DflashErase(flexnvm_config_t *config,
- uint32_t start,
- uint32_t lengthInBytes,
- uint32_t key);
- status_t FLEXNVM_EraseAll(flexnvm_config_t *config, uint32_t key);
- status_t FLEXNVM_EraseAllUnsecure(flexnvm_config_t *config, uint32_t key);
- status_t FLEXNVM_DflashProgram(flexnvm_config_t *config,
- uint32_t start,
- uint8_t *src,
- uint32_t lengthInBytes);
- status_t FLEXNVM_DflashProgramSection(flexnvm_config_t *config,
- uint32_t start,
- uint8_t *src,
- uint32_t lengthInBytes);
- status_t FLEXNVM_ProgramPartition(flexnvm_config_t *config,
- ftfx_partition_flexram_load_opt_t option,
- uint32_t eepromDataSizeCode,
- uint32_t flexnvmPartitionCode);
- status_t FLEXNVM_ReadResource(flexnvm_config_t *config,
- uint32_t start,
- uint8_t *dst,
- uint32_t lengthInBytes,
- ftfx_read_resource_opt_t option);
- status_t FLEXNVM_DflashVerifyErase(flexnvm_config_t *config,
- uint32_t start,
- uint32_t lengthInBytes,
- ftfx_margin_value_t margin);
- status_t FLEXNVM_VerifyEraseAll(flexnvm_config_t *config, ftfx_margin_value_t margin);
- 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);
- status_t FLEXNVM_GetSecurityState(flexnvm_config_t *config, ftfx_security_state_t *state);
- status_t FLEXNVM_SecurityBypass(flexnvm_config_t *config, const uint8_t *backdoorKey);
- status_t FLEXNVM_SetFlexramFunction(flexnvm_config_t *config, ftfx_flexram_func_opt_t option);
- status_t FLEXNVM_EepromWrite(flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes);
- status_t FLEXNVM_DflashSetProtection(flexnvm_config_t *config, uint8_t protectStatus);
- status_t FLEXNVM_DflashGetProtection(flexnvm_config_t *config, uint8_t *protectStatus);
- status_t FLEXNVM_EepromSetProtection(flexnvm_config_t *config, uint8_t protectStatus);
- status_t FLEXNVM_EepromGetProtection(flexnvm_config_t *config, uint8_t *protectStatus);
- status_t FLEXNVM_GetProperty(flexnvm_config_t *config, flexnvm_property_tag_t whichProperty, uint32_t *value);
- }
|