51 #ifndef EEPROM_EMULATION_TYPE_A_H_ 52 #define EEPROM_EMULATION_TYPE_A_H_ 57 #include <ti/devices/msp/msp.h> 58 #include <ti/driverlib/driverlib.h> 59 #include <ti/driverlib/m0p/dl_core.h> 71 #ifndef EEPROM_EMULATION_ADDRESS 72 #define EEPROM_EMULATION_ADDRESS (0x00001000) 77 #define EEPROM_EMULATION_SECTOR_ACCOUNT (2) 81 #define EEPROM_EMULATION_RECORD_SIZE (128) 93 #define EEPROM_EMULATION_DATA_SIZE (EEPROM_EMULATION_RECORD_SIZE - 8) 97 #define EEPROM_EMULATION_RECORD_ACCOUNT (1024 / EEPROM_EMULATION_RECORD_SIZE) 101 #define EEPROM_EMULATION_ACTIVE_RECORD_NUM_MIN (1) 105 #define EEPROM_EMULATION_ACTIVE_RECORD_NUM_MAX \ 106 (EEPROM_EMULATION_RECORD_ACCOUNT) 110 #define EEPROM_EMULATION_ACTIVE_SECTOR_NUM_MIN (1) 114 #define EEPROM_EMULATION_ACTIVE_SECTOR_NUM_MAX \ 115 (EEPROM_EMULATION_SECTOR_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) 138 #define EEPROM_EMULATION_INIT_OK ((uint32_t) 0x00000000U) 142 #define EEPROM_EMULATION_INIT_ERROR ((uint32_t) 0x00000002U) bool EEPROM_TypeA_eraseLastSector(void)
Erase the previous sector of the active sector.
bool gEEPROMTypeASearchFlag
Indicate when the active record exists.
uint16_t gActiveRecordNum
Store the number of active records.
uint32_t EEPROM_TypeA_writeData(uint32_t *data)
Store provided data to the virtual EEPROM.
bool gEEPROMTypeAEraseFlag
Indicate when the sector is full nad needs to be erased.
bool gEEPROMTypeAFormatErrorFlag
Indicate when a format error is found.
bool EEPROM_TypeA_eraseNonActiveSectors(void)
Erases sectors other than the active sector.
uint32_t gActiveRecordAddress
Store the address of the current active record.
bool EEPROM_TypeA_repairFormat(uint32_t *data)
Repair the format.
bool EEPROM_TypeA_eraseAllSectors(void)
Erase all sectors used by EEPROM emulation.
uint32_t gNextRecordAddress
Store the address of the next active record.
void EEPROM_TypeA_readData(uint32_t *data)
Read the data from active record to the buffer in RAM.
uint16_t gActiveSectorNum
Store the number of active sectors.
uint32_t EEPROM_TypeA_init(uint32_t *data)
Initialize the specified area in flash.
void EEPROM_TypeA_searchCheck(void)
Search the active record and check the format.