2020-06-03 15:26:49 +02:00
|
|
|
#ifndef EEStore_h
|
|
|
|
#define EEStore_h
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
2023-01-03 04:02:54 +01:00
|
|
|
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_RP2040)
|
2020-06-03 15:26:49 +02:00
|
|
|
#include <SparkFun_External_EEPROM.h>
|
|
|
|
extern ExternalEEPROM EEPROM;
|
|
|
|
#else
|
|
|
|
#include <EEPROM.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define EESTORE_ID "DCC++"
|
|
|
|
|
|
|
|
struct EEStoreData{
|
|
|
|
char id[sizeof(EESTORE_ID)];
|
|
|
|
int nTurnouts;
|
|
|
|
int nSensors;
|
|
|
|
int nOutputs;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct EEStore{
|
|
|
|
static EEStore *eeStore;
|
|
|
|
EEStoreData data;
|
|
|
|
static int eeAddress;
|
|
|
|
static void init();
|
|
|
|
static void reset();
|
|
|
|
static int pointer();
|
|
|
|
static void advance(int);
|
|
|
|
static void store();
|
|
|
|
static void clear();
|
2020-10-03 14:07:25 +02:00
|
|
|
static void dump(int);
|
2020-06-03 15:26:49 +02:00
|
|
|
};
|
|
|
|
|
2020-07-03 18:35:02 +02:00
|
|
|
#endif
|