PEController BSP v4
Board Support Package for PEController from Taraz Technologies
 
Loading...
Searching...
No Matches
State Storage

This module saves/restores the state information for each module/client. More...

Modules

 Structures
 
 Functions
 

Detailed Description

The storage has to be initialized before use and the callbacks state_storage_client_t::InitStatesFromStorage and state_storage_client_t::RefreshStates need to be defined for each client. The following code is a sample method for using this module effectively.

//Configure the client states' structure @ref state_storage_client_t for each client.
client.dataWordLen = xxxxx; // Set it to the number of 32-bit memory units required.
client.InitStatesFromStorage = xxxxx; // Set the callback to the local function which can initiate local states.
client.RefreshStates = xxxxx; // Set the callback to the local function which can refresh local states storage if states are updated .
//Configure the flash sectors in @ref flash_sector_config_t for both sectors.
//Configure the client count in @ref state_storage_config_t
storage.clientCount = xxxxx;
//Initialize storage
StateStorage_Init(&storageConfig);
//Poll the storage to update states
void StateStorage_Refresh(void)
Refreshes the storage state if required.
Definition state_storage_lib.c:394
void StateStorage_Init(state_storage_config_t *_config)
This function initializes the state storage according to the application requirements.
Definition state_storage_lib.c:283