31#if defined(ARDUINO) && ARDUINO >= 100
34#elif defined(PARTICLE)
95 return EEPROM[address];
104 T oldValue = this->
get();
105 this->
set(oldValue + 1);
115 return this->
set(this->
get() + 1);
124 T oldValue = this->
get();
125 this->
set(this->
get() - 1);
135 return this->
set(this->
get() - 1);
145 return this->
set(this->
get() + value);
155 return this->
set(this->
get() - value);
165 return this->
set(this->
get() * value);
175 return this->
set(this->
get() / value);
185 return this->
set(this->
get() ^ value);
195 return this->
set(this->
get() % value);
205 return this->
set(this->
get() & value);
215 return this->
set(this->
get() | value);
225 return this->
set(this->
get() << value);
235 return this->
set(this->
get() >> value);
255 virtual T
set(T
const& value)
279 EEPROM.get(this->
_address, returnValue);
333 return this->
size() + 1;
357 for (uint i = 0; i < this->
length(); i++)
360 EEPROMUtil.updateEEPROM(address, unsetValue);
396 for (uint i = 0; i <
length; i++)
399 data[i] = EEPROM[address];
460 return min(address, EEPROM.length() - 1);
This file contains the Checksum definition.
This file contains the EEPROMDisplayClass definition.
#define UNSET_VALUE
Defines the default value used when clearing the EEPROM memory.
static byte get(byte *data, uint length)
Calculate the checksum of a byte array.
static byte getEEPROM(uint address, uint length)
Calculates the checksum from data in the EEPROM.
Base class to wrap an EEPROM variable.
uint checksumAddress() const
Gets the address of the checksum byte in EEPROM for this variable.
void write(T const &value) const
Write the value to the EEPROM using the address in this instance.
byte computeChecksum(T value)
Computes the checksum of the given value.
uint nextAddress() const
Gets the next EEPROM address after this variable.
T _defaultValue
The default value.
T operator|=(T const &value)
Bitwise OR assignment operator.
T read() const
Read the variable value from the EEPROM using the address in this variable.
uint _address
The address of this variable in the EEPROM.
T operator+=(T const &value)
Addition assignment operator.
bool isInitialized() const
Checks whether the EEPROM variable has been initialized.
uint size() const
Returns the number of EEPROM bytes used by T.
T operator/=(T const &value)
Division assignment operator.
virtual T set(T const &value)
Set the variable value.
T operator<<=(T const &value)
Bitwise left shift assignment operator.
uint normalizeAddress(uint address) const
Normalize the given EEPROM address to ensure it is within valid range.
T operator-=(T const &value)
Subtraction assignment operator.
T operator^=(T const &value)
Bitwise XOR assignment operator.
void copyTo(byte *data, uint length) const
Copy the EEPROM bytes of this instance to a byte array.
byte operator[](const uint index)
Treating the variable as a byte array, get the byte at position index where index is between 0 and le...
T operator++()
Prefix increment operator.
T operator>>=(T const &value)
Bitwise right shift assignment operator.
virtual T get() const
Get the variable value.
T operator--()
Postfix decrement operator.
EEPROMBase(const uint address)
Initialize an instance of EEPROMBase<T> with the specified address.
byte checksumByte() const
Gets the stored checksum byte.
void unset(byte unsetValue=UNSET_VALUE)
Unset the variable.
T getDefaultValue() const
Gets the default value for this instance.
T operator&=(T const &value)
Bitwise AND assignment operator.
T operator*=(T const &value)
Multiplication assignment operator.
byte checksum() const
Calculate the checksum of the data in the EEPROM for this instance.
uint length() const
Returns the number of EEPROM bytes used.
uint getAddress() const
Get the EEPROM address of the variable.
EEPROMBase(const uint address, T defaultValue)
Initialize an instance of EEPROMBase with the specified address and default value.
T operator%=(T const &value)
Modulus assignment operator.