54 #include <ti/devices/msp/msp.h> 55 #include <ti/driverlib/driverlib.h> 56 #include <ti/driverlib/m0p/dl_core.h> 58 #ifndef EEPROM_EMULATION_TYPE_B_H_ 59 #define EEPROM_EMULATION_TYPE_B_H_ 71 #ifndef EEPROM_EMULATION_ADDRESS 72 #define EEPROM_EMULATION_ADDRESS (0x00001400) 77 #define EEPROM_EMULATION_GROUP_ACCOUNT (3) 81 #define EEPROM_EMULATION_SECTOR_INGROUP_ACCOUNT (2) 85 #define EEPROM_EMULATION_REPAIR_ENABLE (0) 97 #define EEPROM_EMULATION_DATAITEM_ACCOUNT \ 98 (EEPROM_EMULATION_SECTOR_INGROUP_ACCOUNT * 128 - 1) 102 #define EEPROM_EMULATION_ACTIVE_DATAITEM_NUM_MIN (0) 106 #define EEPROM_EMULATION_ACTIVE_DATAITEM_NUM_MAX \ 107 (EEPROM_EMULATION_DATAITEM_ACCOUNT) 111 #define EEPROM_EMULATION_ACTIVE_GROUP_NUM_MIN (1) 115 #define EEPROM_EMULATION_ACTIVE_GROUP_NUM_MAX (EEPROM_EMULATION_GROUP_ACCOUNT) 126 #define EEPROM_EMULATION_WRITE_OK ((uint32_t) 0x00000000U) 130 #define EEPROM_EMULATION_WRITE_ERROR ((uint32_t) 0x00000001U) 134 #define EEPROM_EMULATION_FORMAT_ERROR ((uint32_t) 0x00000010U) 139 #define EEPROM_EMULATION_TRANSFER_OK ((uint32_t) 0x00000000U) 143 #define EEPROM_EMULATION_TRANSFER_ERROR ((uint32_t) 0x00000002U) 148 #define EEPROM_EMULATION_INIT_OK ((uint32_t) 0x00000000U) 152 #define EEPROM_EMULATION_INIT_OK_FORMAT_REPAIR ((uint32_t) 0x00000004U) 156 #define EEPROM_EMULATION_INIT_OK_ALL_ERASE ((uint32_t) 0x00000040U) 160 #define EEPROM_EMULATION_INIT_ERROR ((uint32_t) 0x00000400U) 164 #define EEPROM_EMULATION_FINDITEM_NOT_FOUND ((uint32_t) 0x00000000U) 168 #define CHECK_ONE_ACTIVE_GROUP ((uint32_t) 0x00000000U) 172 #define CHECK_NO_ACTIVE_ONE_ERROR_GROUP ((uint32_t) 0x00000001U) 176 #define CHECK_NO_ACTIVE_NO_ERROR_GROUP ((uint32_t) 0x00000002U) 227 uint16_t groupNum, uint16_t dataItemNum);
278 uint16_t identifier, uint16_t groupNum, uint16_t dataItemNum);
bool EEPROM_TypeB_eraseNonActiveGroups(void)
Erases groups other than the active group.
uint16_t gActiveDataItemNum
Store the number of active data items.
bool EEPROM_TypeB_eraseGroup(void)
Erases the 'Erasing' group.
uint32_t EEPROM_TypeB_readDataItem(uint16_t identifier)
Read the latest data item based on the identifier.
uint32_t EEPROM_TypeB_writeDataItem(uint16_t identifier, uint32_t data, uint16_t groupNum, uint16_t dataItemNum)
Store provided data and identifier to the specified data item.
uint32_t EEPROM_TypeB_findDataItem(uint16_t identifier, uint16_t groupNum, uint16_t dataItemNum)
Find the latest data item based on the identifier.
uint32_t EEPROM_TypeB_checkFormat(void)
Search the active group and check the format.
uint32_t EEPROM_TypeB_write(uint16_t identifier, uint32_t data)
Write provided data and identifier to the Flash.
bool gEEPROMTypeBEraseFlag
Indicate when the group is full nad needs to be erased.
uint32_t EEPROM_TypeB_init(void)
Initialize the specified area in flash.
uint16_t gActiveGroupNum
Store the number of active groups.
uint32_t EEPROM_TypeB_transferDataItem(uint16_t groupNum)
Transfer the data items to next group.
bool EEPROM_TypeB_eraseAllGroups(void)
Erase all groups used by EEPROM emulation.
bool gEEPROMTypeBSearchFlag
Indicate when the data item is found.