Firmware SDK
twr_config

Library for saving and loading configuration to EEPROM. More...

Functions

void twr_config_init (uint64_t signature, void *config, size_t size, void *init_config)
 Initialize and load the config from EEPROM. More...
 
void twr_config_reset (void)
 Reset EEPROM configuration to zeros or init_config.
 
bool twr_config_load (void)
 Load EEPROM configuration. More...
 
bool twr_config_save (void)
 Save configuration to EEPROM. More...
 

Detailed Description

Library for saving and loading configuration to EEPROM.

Function Documentation

◆ twr_config_init()

void twr_config_init ( uint64_t  signature,
void *  config,
size_t  size,
void *  init_config 
)

Initialize and load the config from EEPROM.

Parameters
[in]signatureAny number specifying current configuration version.
[in]configPointer to configuration structure
[in]sizeSize of the configuration structure
[in]init_configPointer to default configoration or null

Definition at line 39 of file twr_config.c.

Here is the call graph for this function:

◆ twr_config_load()

bool twr_config_load ( void  )

Load EEPROM configuration.

Returns
true When configuration is valid
false When configuration is invalid

Definition at line 66 of file twr_config.c.

Referenced by twr_config_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ twr_config_save()

bool twr_config_save ( void  )

Save configuration to EEPROM.

Returns
true When configuration was saved
false When there is a write error

Definition at line 95 of file twr_config.c.

Referenced by twr_config_init().

Here is the call graph for this function:
Here is the caller graph for this function: