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

Detailed Description

EEPROM Emulation Type B.


#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_b.h:

Go to the source code of this file.

Macros

#define EEPROM_EMULATION_ADDRESS   (0x00001400)
 The sector address to use.
 
#define EEPROM_EMULATION_GROUP_ACCOUNT   (3)
 The number of groups to use.
 
#define EEPROM_EMULATION_SECTOR_INGROUP_ACCOUNT   (2)
 The number of sectors in groups to use.
 
#define EEPROM_EMULATION_REPAIR_ENABLE   (0)
 Enable or disable repair.
 
#define EEPROM_EMULATION_DATAITEM_ACCOUNT   (EEPROM_EMULATION_SECTOR_INGROUP_ACCOUNT * 128 - 1)
 The number of data items.
 
#define EEPROM_EMULATION_ACTIVE_DATAITEM_NUM_MIN   (0)
 The minimum number of data items.
 
#define EEPROM_EMULATION_ACTIVE_DATAITEM_NUM_MAX   (EEPROM_EMULATION_DATAITEM_ACCOUNT)
 The maximum number of data items.
 
#define EEPROM_EMULATION_ACTIVE_GROUP_NUM_MIN   (1)
 The minimum number of groups.
 
#define EEPROM_EMULATION_ACTIVE_GROUP_NUM_MAX   (EEPROM_EMULATION_GROUP_ACCOUNT)
 The maximum number of groups.
 
#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_TRANSFER_OK   ((uint32_t) 0x00000000U)
 Transfer is successful.
 
#define EEPROM_EMULATION_TRANSFER_ERROR   ((uint32_t) 0x00000002U)
 Transfer failed.
 
#define EEPROM_EMULATION_INIT_OK   ((uint32_t) 0x00000000U)
 Initialization is successful.
 
#define EEPROM_EMULATION_INIT_OK_FORMAT_REPAIR   ((uint32_t) 0x00000004U)
 Initialization is successful with format repair.
 
#define EEPROM_EMULATION_INIT_OK_ALL_ERASE   ((uint32_t) 0x00000040U)
 Initialization is all erased.
 
#define EEPROM_EMULATION_INIT_ERROR   ((uint32_t) 0x00000400U)
 Initialization failed.
 
#define EEPROM_EMULATION_FINDITEM_NOT_FOUND   ((uint32_t) 0x00000000U)
 Item not found error.
 
#define CHECK_ONE_ACTIVE_GROUP   ((uint32_t) 0x00000000U)
 Group is active.
 
#define CHECK_NO_ACTIVE_ONE_ERROR_GROUP   ((uint32_t) 0x00000001U)
 The next address was not erased.
 
#define CHECK_NO_ACTIVE_NO_ERROR_GROUP   ((uint32_t) 0x00000002U)
 Writing new data item was not successful.
 

Functions

uint32_t EEPROM_TypeB_write (uint16_t identifier, uint32_t data)
 Write provided data and identifier to the Flash. More...
 
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. More...
 
uint32_t EEPROM_TypeB_transferDataItem (uint16_t groupNum)
 Transfer the data items to next group. More...
 
uint32_t EEPROM_TypeB_readDataItem (uint16_t identifier)
 Read the latest data item based on the identifier. More...
 
uint32_t EEPROM_TypeB_findDataItem (uint16_t identifier, uint16_t groupNum, uint16_t dataItemNum)
 Find the latest data item based on the identifier. More...
 
uint32_t EEPROM_TypeB_init (void)
 Initialize the specified area in flash. More...
 
uint32_t EEPROM_TypeB_checkFormat (void)
 Search the active group and check the format. More...
 
bool EEPROM_TypeB_eraseGroup (void)
 Erases the 'Erasing' group. More...
 
bool EEPROM_TypeB_eraseNonActiveGroups (void)
 Erases groups other than the active group. More...
 
bool EEPROM_TypeB_eraseAllGroups (void)
 Erase all groups used by EEPROM emulation. More...
 

Variables

uint16_t gActiveDataItemNum
 Store the number of active data items.
 
uint16_t gActiveGroupNum
 Store the number of active groups.
 
bool gEEPROMTypeBSearchFlag
 Indicate when the data item is found.
 
bool gEEPROMTypeBEraseFlag
 Indicate when the group is full nad needs to be erased.
 
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale