33 const size_t EEPROM_MIN_SIZE = 16;
40 void begin(
size_t size);
41 uint8_t
read(
int const address);
42 void write(
int const address, uint8_t
const val);
64 T &
get(
int const address, T &v) {
65 if (_data && (address >= 0) && (address +
sizeof(T) <= _size)) {
66 memcpy((uint8_t*) &v, _data + address,
sizeof(T));
88 const T &
put(
int const address,
const T &v) {
89 if (_data && (address >= 0) && (address +
sizeof(T) <= _size)) {
93 || memcmp(_data + address, (
const uint8_t*) &v,
sizeof(T))
96 memcpy(_data + address, (
const uint8_t*) &v,
sizeof(T));
117 uint16_t _bitmapSize;
122 uint16_t offsetFromBitmap();
123 int flagUsedOffset();
124 uint16_t computeBitmapSize(
size_t size);
127 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM) int percentUsed()
Returns the percentage of EEPROM flash memory area that has been used by copies of our EEPROM data...
Definition: ESP_EEPROM.cpp:234
const T & put(int const address, const T &v)
Write data to the EEPROM buffer.
Definition: ESP_EEPROM.h:88
EEPROMClass(void)
Create an instance of the EEPROM class based on the default EEPROM flash sector.
Definition: ESP_EEPROM.cpp:133
void write(int const address, uint8_t const val)
Write a byte of data to an address within the the library's EEPROM data buffer.
Definition: ESP_EEPROM.cpp:296
bool wipe()
Force an immediate erase of the flash sector - but nothing is written.
Definition: ESP_EEPROM.cpp:421
uint8_t read(int const address)
Read a byte of data from an offset in the buffered EEPROM data.
Definition: ESP_EEPROM.cpp:277
size_t length()
Get the size of the EEPROM buffer.
Definition: ESP_EEPROM.h:107
The ESP does not have a genuine EEPROM memory so this needs to be emulated using a segment of flash m...
Definition: ESP_EEPROM.h:35
bool commitReset()
Perform an erase of the flash sector before committing the data.
Definition: ESP_EEPROM.cpp:315
void begin(size_t size)
Initialise the EEPROM system, reading from flash if there appears to be suitable data already there...
Definition: ESP_EEPROM.cpp:159
void end()
Free up storage used by the library.
Definition: ESP_EEPROM.cpp:248
bool commit()
Write the EEPROM data to the flash memory.
Definition: ESP_EEPROM.cpp:339