EEPROM Library Overview  1.0.0.x
Macros | Functions | Variables
eeprom_emulation_type_a.h File Reference

Detailed Description

EEPROM Emulation Type A.


#include <stdbool.h>
#include <stdint.h>
#include <ti/devices/msp/msp.h>
#include <ti/driverlib/driverlib.h>
#include <ti/driverlib/m0p/dl_core.h>
Include dependency graph for eeprom_emulation_type_a.h:

Go to the source code of this file.

Macros

#define EEPROM_EMULATION_ADDRESS   (0x00001000)
 The sector address to use.
 
#define EEPROM_EMULATION_SECTOR_ACCOUNT   (2)
 The number of sectors to use.
 
#define EEPROM_EMULATION_RECORD_SIZE   (128)
 The record size. Valid values are 64 (64B), 128 (128B), or 256 (256B).
 
#define EEPROM_EMULATION_DATA_SIZE   (EEPROM_EMULATION_RECORD_SIZE - 8)
 The size of the data.
 
#define EEPROM_EMULATION_RECORD_ACCOUNT   (1024 / EEPROM_EMULATION_RECORD_SIZE)
 The number of records in a sector.
 
#define EEPROM_EMULATION_ACTIVE_RECORD_NUM_MIN   (1)
 The minimum number of records in a sector.
 
#define EEPROM_EMULATION_ACTIVE_RECORD_NUM_MAX   (EEPROM_EMULATION_RECORD_ACCOUNT)
 The maximum number of records in a sector.
 
#define EEPROM_EMULATION_ACTIVE_SECTOR_NUM_MIN   (1)
 The minimum number of active sectors.
 
#define EEPROM_EMULATION_ACTIVE_SECTOR_NUM_MAX   (EEPROM_EMULATION_SECTOR_ACCOUNT)
 The maximum number of active sectors.
 
#define EEPROM_EMULATION_WRITE_OK   ((uint32_t) 0x00000000U)
 Data write is successful.
 
#define EEPROM_EMULATION_WRITE_ERROR   ((uint32_t) 0x00000001U)
 Data write failed.
 
#define EEPROM_EMULATION_FORMAT_ERROR   ((uint32_t) 0x00000010U)
 Formatting error.
 
#define EEPROM_EMULATION_INIT_OK   ((uint32_t) 0x00000000U)
 Initialization is successful.
 
#define EEPROM_EMULATION_INIT_ERROR   ((uint32_t) 0x00000002U)
 Initialization failed.
 

Functions

uint32_t EEPROM_TypeA_writeData (uint32_t *data)
 Store provided data to the virtual EEPROM. More...
 
uint32_t EEPROM_TypeA_init (uint32_t *data)
 Initialize the specified area in flash. More...
 
void EEPROM_TypeA_readData (uint32_t *data)
 Read the data from active record to the buffer in RAM. More...
 
bool EEPROM_TypeA_repairFormat (uint32_t *data)
 Repair the format. More...
 
void EEPROM_TypeA_searchCheck (void)
 Search the active record and check the format. More...
 
bool EEPROM_TypeA_eraseLastSector (void)
 Erase the previous sector of the active sector. More...
 
bool EEPROM_TypeA_eraseNonActiveSectors (void)
 Erases sectors other than the active sector. More...
 
bool EEPROM_TypeA_eraseAllSectors (void)
 Erase all sectors used by EEPROM emulation. More...
 

Variables

uint32_t gActiveRecordAddress
 Store the address of the current active record.
 
uint32_t gNextRecordAddress
 Store the address of the next active record.
 
uint16_t gActiveRecordNum
 Store the number of active records.
 
uint16_t gActiveSectorNum
 Store the number of active sectors.
 
bool gEEPROMTypeASearchFlag
 Indicate when the active record exists.
 
bool gEEPROMTypeAEraseFlag
 Indicate when the sector is full nad needs to be erased.
 
bool gEEPROMTypeAFormatErrorFlag
 Indicate when a format error is found.
 
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale