Larus glider flight sensor system 3.9.2024
Software-In-The-Loop test and validation system
Loading...
Searching...
No Matches
persistent_data.cpp File Reference

definitions for persistent data in EEPROM or config. file More...

#include "system_configuration.h"
#include "embedded_memory.h"
#include "embedded_math.h"
#include "persistent_data.h"
#include "string.h"
#include "eeprom.h"
#include "my_assert.h"

Go to the source code of this file.

Macros

#define READ   true
 
#define WRITE   false
 

Functions

void ensure_EEPROM_parameter_integrity (void)
 
const persistent_data_tfind_parameter_from_name (char *name)
 
const persistent_data_tfind_parameter_from_ID (EEPROM_PARAMETER_ID id)
 
bool EEPROM_convert (EEPROM_PARAMETER_ID id, EEPROM_data_t &EEPROM_value, float &value, bool read)
 
bool lock_EEPROM (bool lockit)
 
bool write_EEPROM_value (EEPROM_PARAMETER_ID id, float value)
 
bool read_EEPROM_value (EEPROM_PARAMETER_ID id, float &value)
 
float configuration (EEPROM_PARAMETER_ID id)
 
bool EEPROM_initialize (void)
 

Variables

ROM persistent_data_t PERSISTENT_DATA []
 
ROM unsigned PERSISTENT_DATA_ENTRIES = sizeof(PERSISTENT_DATA) / sizeof(persistent_data_t)
 

Detailed Description

definitions for persistent data in EEPROM or config. file

Author
Dr. Klaus Schaefer

<Larus Flight Sensor Firmware>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file persistent_data.cpp.

Macro Definition Documentation

◆ READ

#define READ   true

Definition at line 107 of file persistent_data.cpp.

◆ WRITE

#define WRITE   false

Definition at line 108 of file persistent_data.cpp.

Function Documentation

◆ configuration()

float configuration ( EEPROM_PARAMETER_ID  id)

Definition at line 240 of file persistent_data.cpp.

References read_EEPROM_value().

Referenced by organizer_t::initialize_before_measurement().

◆ EEPROM_convert()

bool EEPROM_convert ( EEPROM_PARAMETER_ID  id,
EEPROM_data_t EEPROM_value,
float value,
bool  read 
)

Definition at line 110 of file persistent_data.cpp.

References M_PI_F.

Referenced by read_EEPROM_value(), and write_EEPROM_value().

◆ EEPROM_initialize()

bool EEPROM_initialize ( void  )

◆ ensure_EEPROM_parameter_integrity()

void ensure_EEPROM_parameter_integrity ( void  )

◆ find_parameter_from_ID()

const persistent_data_t * find_parameter_from_ID ( EEPROM_PARAMETER_ID  id)

Definition at line 94 of file persistent_data.cpp.

References PERSISTENT_DATA, and PERSISTENT_DATA_ENTRIES.

Referenced by read_EEPROM_file().

◆ find_parameter_from_name()

const persistent_data_t * find_parameter_from_name ( char name)

Definition at line 86 of file persistent_data.cpp.

References PERSISTENT_DATA, and PERSISTENT_DATA_ENTRIES.

◆ lock_EEPROM()

bool lock_EEPROM ( bool  lockit)

◆ read_EEPROM_value()

◆ write_EEPROM_value()

Variable Documentation

◆ PERSISTENT_DATA

ROM persistent_data_t PERSISTENT_DATA[]
Initial value:
=
{
{SENS_TILT_ROLL,"SensTilt_Roll", true, 0.0f, 0},
{SENS_TILT_PITCH,"SensTilt_Pitch", true, 0.0f, 0},
{SENS_TILT_YAW, "SensTilt_Yaw", true, 0.0f, 0},
{PITOT_OFFSET, "Pitot_Offset", false, 0.0f, 0},
{PITOT_SPAN, "Pitot_Span", false, 1.0f, 0},
{QNH_OFFSET, "QNH-delta", false, 0.0f, 0},
{MAG_X_OFF, "Mag_X_Off", false, 0.0f, 0},
{MAG_X_SCALE, "Mag_X_Scale", false, 1.0f, 0},
{MAG_Y_OFF, "Mag_Y_Off", false, 0.0f, 0},
{MAG_Y_SCALE, "Mag_Y_Scale", false, 1.0f, 0},
{MAG_Z_OFF, "Mag_Z_Off", false, 0.0f, 0},
{MAG_Z_SCALE, "Mag_Z_Scale", false, 1.0f, 0},
{MAG_STD_DEVIATION, "Mag_Calib_Err", false, 1e-2f, 0},
{MAG_AUTO_CALIB, "Mag_Auto_Calib", false, 1.0f, 0},
{VARIO_TC, "Vario_TC", false, 2.0f, 0},
{VARIO_INT_TC, "Vario_Int_TC", false, 30.0f, 0},
{WIND_TC, "Wind_TC", false, 5.0f, 0},
{MEAN_WIND_TC, "Mean_Wind_TC", false, 30.0f, 0},
{HORIZON, "Horizon_active", false, 1.0f, 0},
{GNSS_CONFIGURATION, "GNSS_CONFIG", false, 1.0f, 0},
{ANT_BASELENGTH, "ANT_BASELEN", false, 1.0f, 0},
{ANT_SLAVE_DOWN, "ANT_SLAVE_DOWN", false, 0.0f, 0},
{ANT_SLAVE_RIGHT,"ANT_SLAVE_RIGHT", false, 0.0f, 0},
}
mathematical vector of arbitrary type and size
Definition vector.h:40

Definition at line 31 of file persistent_data.cpp.

Referenced by ensure_EEPROM_parameter_integrity(), find_parameter_from_ID(), find_parameter_from_name(), and write_EEPROM_dump().

◆ PERSISTENT_DATA_ENTRIES