DCCpp
This is the library version of a program for Arduino to control railroading DCC devices.
EEStore.h
1 /**********************************************************************
2 
3 EEStore.h
4 COPYRIGHT (c) 2013-2016 Gregg E. Berman
5 
6 Part of DCC++ BASE STATION for the Arduino
7 
8 **********************************************************************/
9 
10 #ifdef ARDUINO_ARCH_AVR
11 #ifndef EEStore_h
12 #define EEStore_h
13 
14 #include "DCCpp.h"
15 
16 #ifdef USE_EEPROM
17 
18 #define EESTORE_ID "DCC++"
19 
21 struct EEStoreData{
22  char id[sizeof(EESTORE_ID)+1];
23 #ifdef USE_TURNOUT
24  int nTurnouts;
25 #endif
26 #ifdef USE_SENSOR
27  int nSensors;
28 #endif
29 #ifdef USE_OUTPUT
30  int nOutputs;
31 #endif
32 };
33 
44 struct EEStore{
45  //static EEStore *eeStore; /**< Static pointer to an instance of EEStore class.*/
46  static EEStoreData data;
47  static int eeAddress;
49  static void init();
50  static void reset();
54  static int pointer();
58  static void advance(int inIncrement);
62  static bool needsRefreshing();
63  static void store();
64  static void clear();
65 };
66 
67 #endif
68 #endif
69 #endif