IoAbstraction
Public Member Functions | List of all members
ArduinoEEPROMAbstraction Class Reference

#include <ArduinoEEPROMAbstraction.h>

Inheritance diagram for ArduinoEEPROMAbstraction:
EepromAbstraction

Public Member Functions

 ArduinoEEPROMAbstraction (EEPROMClass *proxy)
 
uint8_t read8 (EepromPosition position) override
 
uint16_t read16 (EepromPosition pos) override
 
uint32_t read32 (EepromPosition pos) override
 
void write8 (EepromPosition pos, uint8_t val) override
 
void write16 (EepromPosition pos, uint16_t val) override
 
void write32 (EepromPosition pos, uint32_t val) override
 
void readIntoMemArray (uint8_t *memDest, EepromPosition romSrc, uint8_t len) override
 
void writeArrayToRom (EepromPosition romDest, const uint8_t *memSrc, uint8_t len) override
 
- Public Member Functions inherited from EepromAbstraction
virtual bool hasErrorOccurred ()
 

Detailed Description

Provides a wrapper around the EEPROM class available on some Arduino boards. For AVR 8bit boards such as Uno and Mega, there are no notes, it neatly wraps the class.

Extra notes for ESP8266, ESP32 and any other FLASH emulated implementation: When the ESP EEPROM wrapper is used, then you need to ensure that you call begin(size) before use and commit() before shutting down, otherwise changes will not be saved. Be very aware that you must not commit too frequently; otherwise your board's FLASH will be damaged. I recommend the very cheap i2c AT24Cxxx EEPROM devices which cost about $1 and you will not risk damaging your FLASH. Me having implemented this is not an indicator that I agree with using FLASH as EEPROM, I personally wouldn't do that on a production board.

Member Function Documentation

◆ read8()

uint8_t ArduinoEEPROMAbstraction::read8 ( EepromPosition  position)
inlineoverridevirtual

Read an 8 bit (byte) value at a specified position

Parameters
positionaddress at which to read

Implements EepromAbstraction.

◆ read16()

uint16_t ArduinoEEPROMAbstraction::read16 ( EepromPosition  position)
inlineoverridevirtual

read a 16 bit value at position at a specified position

Parameters
positionthe position at which to read

Implements EepromAbstraction.

◆ read32()

uint32_t ArduinoEEPROMAbstraction::read32 ( EepromPosition  position)
inlineoverridevirtual

read a 32 bit value at a specified position

Parameters
positionthe position at which to read

Implements EepromAbstraction.

◆ write8()

void ArduinoEEPROMAbstraction::write8 ( EepromPosition  position,
uint8_t  val 
)
inlineoverridevirtual

write an 8 bit (byte) value to the specified position

Parameters
positionthe position at which to write
valthe new value

Implements EepromAbstraction.

◆ write16()

void ArduinoEEPROMAbstraction::write16 ( EepromPosition  position,
uint16_t  val 
)
inlineoverridevirtual

write a 16 bit value to the specified position

Parameters
positionthe position at which to write
valthe value to read

Implements EepromAbstraction.

◆ write32()

void ArduinoEEPROMAbstraction::write32 ( EepromPosition  position,
uint32_t  val 
)
inlineoverridevirtual

write a 32 bit value to position

Parameters
positionthe position at which to write
valthe value to write out.

Implements EepromAbstraction.

◆ readIntoMemArray()

void ArduinoEEPROMAbstraction::readIntoMemArray ( uint8_t *  memDest,
EepromPosition  romSrc,
uint8_t  len 
)
inlineoverridevirtual

Read an array of bytes from EEPROM into memory

Parameters
memDestthe memory where the EEPROM data should be copied to
romSrcthe source position in EEPROM storage
lenthe length of the array

Implements EepromAbstraction.

◆ writeArrayToRom()

void ArduinoEEPROMAbstraction::writeArrayToRom ( EepromPosition  romDest,
const uint8_t *  memSrc,
uint8_t  len 
)
inlineoverridevirtual

Writes an array of bytes from memory to EEPROM storage

Parameters
romDestthe start position in eeprom storage that the array should be copied to
memSrcthe memory where the rom should be copied from
lenthe length of the array

Implements EepromAbstraction.


The documentation for this class was generated from the following file: