![]() |
Speeduino
|
#include "globals.h"#include "storage.h"#include "pages.h"#include "sensors.h"#include "preprocessor.h"#include "unit_testing.h"#include "scheduler.h"#include "storage_details.h"Classes | |
| struct | write_location |
Macros | |
| #define | WRITE_TRIM_TABLE(index) writeTable(trimTables[index-1U], EEPROM_CONFIG8_MAP ## index, writesRemaining) |
| #define | LOAD_TRIM_TABLE(index) (void)loadTable(trimTables[index-1U], EEPROM_CONFIG8_MAP ## index) |
Functions | |
| static byte | default_read (uint16_t address) |
| static void | default_write (uint16_t address, byte value) |
| static uint16_t | default_length (void) |
| static uint16_t | default_write_size (const statuses ¤t) |
| void | setStorageAPI (const storage_api_t &api) |
| Inject the external storage API. | |
| const storage_api_t & | getStorageAPI (void) |
| Provide global access to the raw storage API. | |
| TESTABLE_INLINE_STATIC uint16_t | getSensorCalibrationAddress (SensorCalibrationTable sensor, SensorCalibrationTableElement element) |
| bool | isEepromWritePending (void) |
| Do we have page data that needs to be written to durable storage? | |
| void | setEepromWritePending (bool isPending) |
| Set or clear the Write Pending flag. | |
| void | saveAllPages (void) |
| Write all pages from RAM to durable storage. | |
| static uint16_t | write_range (const byte *pStart, const byte *pEnd, uint16_t address, uint16_t writesRemaining) |
| template<typename Iter > | |
| static write_location | write_range (Iter pStart, Iter pEnd, write_location location) |
| template<typename TTable > | |
| static uint16_t | writeTable (const TTable &table, uint16_t address, uint16_t writesRemaining) |
| void | savePage (uint8_t pageNum) |
| Write one page from RAM to durable storage. | |
| static uint16_t | load_range (uint16_t address, byte *pFirst, const byte *pLast) |
| template<typename Iter > | |
| static uint16_t | load_range (Iter pStart, Iter pEnd, uint16_t address) |
| template<typename TTable > | |
| static uint16_t | loadTable (TTable &table, uint16_t address) |
| void | loadAllPages (void) |
| Load all pages from durable storage. I.e. load the tune. | |
| void | loadAllCalibrationTables (void) |
| Load the curves for all sensors from durable storage. | |
| void | saveAllCalibrationTables (void) |
| Store the curves for all sensors in durable storage. | |
| void | saveCalibrationTable (SensorCalibrationTable sensor) |
| Store one sensor curve in durable storage. | |
| void | saveCalibrationCrc (SensorCalibrationTable sensor, uint32_t calibrationCRC) |
| Store the CRC for one sensor curve in durable storage. | |
| uint32_t | loadCalibrationCrc (SensorCalibrationTable sensor) |
| Retrieve the CRC for one sensor curve from durable storage. | |
| uint8_t | loadLastBaro (void) |
| Last barometer reading cache. | |
| void | saveLastBaro (uint8_t newValue) |
| Last barometer reading cache. | |
| uint8_t | loadEEPROMVersion (void) |
| Save/load the version number of the storage layout. | |
| void | saveEEPROMVersion (uint8_t newVersion) |
| Save/load the version number of the storage layout. | |
Variables | |
| static storage_api_t | externalApi |
| constexpr uint16_t | EEPROM_DATA_VERSION = 0 |
| constexpr uint16_t | STORAGE_END = 0xFFF |
| constexpr uint16_t | EEPROM_CALIBRATION_CLT_VALUES = STORAGE_END-getCalibrationElementSize(SensorCalibrationTable::CoolantSensor, SensorCalibrationTableElement::Values) |
| constexpr uint16_t | EEPROM_CALIBRATION_CLT_BINS = EEPROM_CALIBRATION_CLT_VALUES-getCalibrationElementSize(SensorCalibrationTable::CoolantSensor, SensorCalibrationTableElement::Bins) |
| constexpr uint16_t | EEPROM_CALIBRATION_IAT_VALUES = EEPROM_CALIBRATION_CLT_BINS-getCalibrationElementSize(SensorCalibrationTable::IntakeAirTempSensor, SensorCalibrationTableElement::Values) |
| constexpr uint16_t | EEPROM_CALIBRATION_IAT_BINS = EEPROM_CALIBRATION_IAT_VALUES-getCalibrationElementSize(SensorCalibrationTable::IntakeAirTempSensor, SensorCalibrationTableElement::Bins) |
| constexpr uint16_t | EEPROM_CALIBRATION_O2_VALUES = EEPROM_CALIBRATION_IAT_BINS-getCalibrationElementSize(SensorCalibrationTable::O2Sensor, SensorCalibrationTableElement::Values) |
| constexpr uint16_t | EEPROM_CALIBRATION_O2_BINS = EEPROM_CALIBRATION_O2_VALUES-getCalibrationElementSize(SensorCalibrationTable::O2Sensor, SensorCalibrationTableElement::Bins) |
| constexpr uint16_t | EEPROM_LAST_BARO = (EEPROM_CALIBRATION_O2_BINS-(uint16_t)1) |
| constexpr uint16_t | EEPROM_CONFIG1_MAP = 3 |
| constexpr uint16_t | EEPROM_CONFIG2_START = 291 |
| constexpr uint16_t | EEPROM_CONFIG3_MAP = 421 |
| constexpr uint16_t | EEPROM_CONFIG4_START = 709 |
| constexpr uint16_t | EEPROM_CONFIG5_MAP = 839 |
| constexpr uint16_t | EEPROM_CONFIG6_START = 1127 |
| constexpr uint16_t | EEPROM_CONFIG7_MAP1 = 1257 |
| constexpr uint16_t | EEPROM_CONFIG7_MAP2 = 1339 |
| constexpr uint16_t | EEPROM_CONFIG7_MAP3 = 1421 |
| constexpr uint16_t | EEPROM_CONFIG8_MAP1 = 1503 |
| constexpr uint16_t | EEPROM_CONFIG8_MAP2 = 1553 |
| constexpr uint16_t | EEPROM_CONFIG8_MAP3 = 1603 |
| constexpr uint16_t | EEPROM_CONFIG8_MAP4 = 1653 |
| constexpr uint16_t | EEPROM_CONFIG9_START = 1710 |
| constexpr uint16_t | EEPROM_CONFIG10_START = 1902 |
| constexpr uint16_t | EEPROM_CONFIG11_MAP = 2096 |
| constexpr uint16_t | EEPROM_CONFIG12_MAP = 2387 |
| constexpr uint16_t | EEPROM_CONFIG12_MAP2 = 2469 |
| constexpr uint16_t | EEPROM_CONFIG12_MAP3 = 2551 |
| constexpr uint16_t | EEPROM_CONFIG13_START = 2580 |
| constexpr uint16_t | EEPROM_CONFIG14_MAP = 2710 |
| constexpr uint16_t | EEPROM_CONFIG8_MAP5 = 3001 |
| constexpr uint16_t | EEPROM_CONFIG8_MAP6 = 3051 |
| constexpr uint16_t | EEPROM_CONFIG8_MAP7 = 3101 |
| constexpr uint16_t | EEPROM_CONFIG8_MAP8 = 3151 |
| constexpr uint16_t | EEPROM_CONFIG15_MAP = 3199 |
| constexpr uint16_t | EEPROM_CONFIG15_START = 3281 |
Lower level ConfigPage*, Table2D, Table3D and EEPROM storage operations.
| #define LOAD_TRIM_TABLE | ( | index | ) | (void)loadTable(trimTables[index-1U], EEPROM_CONFIG8_MAP ## index) |
| #define WRITE_TRIM_TABLE | ( | index | ) | writeTable(trimTables[index-1U], EEPROM_CONFIG8_MAP ## index, writesRemaining) |
|
static |
|
static |
|
static |
|
static |
| TESTABLE_INLINE_STATIC uint16_t getSensorCalibrationAddress | ( | SensorCalibrationTable | sensor, |
| SensorCalibrationTableElement | element | ||
| ) |
| const storage_api_t & getStorageAPI | ( | void | ) |
Provide global access to the raw storage API.
|
inlinestatic |
Load range of bytes form EEPROM offset to memory.
| address | - start offset in EEPROM |
| pFirst | - Start memory address |
| pLast | - End memory address |
|
inlinestatic |
| void setStorageAPI | ( | const storage_api_t & | api | ) |
Inject the external storage API.
Storage is split into two components:
| api | The external storage I/O functions |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
static |
|
constexpr |