DCCpp
This is the library version of a program for Arduino to control railroading DCC devices.
EEStore Struct Reference

#include "EEStore.h"

Static Public Member Functions

static void init ()
 
static void reset ()
 
static int pointer ()
 
static void advance (int inIncrement)
 
static bool needsRefreshing ()
 
static void store ()
 
static void clear ()
 

Static Public Attributes

static EEStoreData data
 
static int eeAddress =0
 

Detailed Description

This structure/class stores accessories data in EEPROM.

The data is saved from byte 0 of EEPROM. The content is :

0--------------------------------------+----------+---------+---------+
| EEStoreData(see EEstoreData content) | Turnouts | Sensors | Outputs |
+--------------------------------------+----------+---------+---------+

Definition at line 43 of file EEStore.h.

Member Function Documentation

void init ( )
static

Clear all the EEPROM memory.

Definition at line 24 of file EEStore.cpp.

void reset ( )
static

Restart the eeAddress pointer at the end of the EEStoreData.

Definition at line 134 of file EEStore.cpp.

int pointer ( )
static

Gets the current EEPROM address.

Returns
current position in EEPROM memory.

Definition at line 139 of file EEStore.cpp.

void advance ( int  inIncrement)
static

Move the EEPROM address of the given value.

Parameters
inIncrementnumber of bytes to shift.

Definition at line 128 of file EEStore.cpp.

bool needsRefreshing ( )
static

Checks if numbers of accessories have changed which needs to store new states.

Returns
True if the total number of accessories have changed.

Definition at line 110 of file EEStore.cpp.

void store ( )
static

Stores the current state of all accessories.

Definition at line 90 of file EEStore.cpp.

void clear ( )
static

Clears the content of the EEStoreData structure. This function does not change the EEPROM.

Definition at line 68 of file EEStore.cpp.

Member Data Documentation

EEStoreData data
static

Data associated with this class.

Definition at line 45 of file EEStore.h.

int eeAddress =0
static

Current EEPROM address. Used during storage.

Definition at line 46 of file EEStore.h.