IoAbstraction
Public Member Functions | List of all members
EepromAbstraction Class Referenceabstract

#include <EepromAbstraction.h>

Inheritance diagram for EepromAbstraction:
ArduinoEEPROMAbstraction AvrEeprom I2cAt24Eeprom MockEepromAbstraction NoEeprom

Public Member Functions

virtual bool hasErrorOccurred ()
 
virtual uint8_t read8 (EepromPosition position)=0
 
virtual void write8 (EepromPosition position, uint8_t val)=0
 
virtual uint16_t read16 (EepromPosition position)=0
 
virtual void write16 (EepromPosition position, uint16_t val)=0
 
virtual uint32_t read32 (EepromPosition position)=0
 
virtual void write32 (EepromPosition position, uint32_t val)=0
 
virtual void readIntoMemArray (uint8_t *memDest, EepromPosition romSrc, uint8_t len)=0
 
virtual void writeArrayToRom (EepromPosition romDest, const uint8_t *memSrc, uint8_t len)=0
 

Detailed Description

Provides an abstraction on eeprom storage, to allow either on chip or external I2c based eeprom storage, or even No storage whatsoever. This helps no end with 32 bit boards that don't have eeprom! Most EEPROM implementions here only write if there are changes.

Member Function Documentation

◆ hasErrorOccurred()

virtual bool EepromAbstraction::hasErrorOccurred ( )
inlinevirtual

Best efforts error flag that will clear once read.

Reimplemented in MockEepromAbstraction, and I2cAt24Eeprom.

◆ read8()

virtual uint8_t EepromAbstraction::read8 ( EepromPosition  position)
pure virtual

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

Parameters
positionaddress at which to read

Implemented in MockEepromAbstraction, I2cAt24Eeprom, ArduinoEEPROMAbstraction, and AvrEeprom.

◆ write8()

virtual void EepromAbstraction::write8 ( EepromPosition  position,
uint8_t  val 
)
pure virtual

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

Parameters
positionthe position at which to write
valthe new value

Implemented in MockEepromAbstraction, I2cAt24Eeprom, AvrEeprom, and ArduinoEEPROMAbstraction.

◆ read16()

virtual uint16_t EepromAbstraction::read16 ( EepromPosition  position)
pure virtual

read a 16 bit value at position at a specified position

Parameters
positionthe position at which to read

Implemented in MockEepromAbstraction, I2cAt24Eeprom, AvrEeprom, and ArduinoEEPROMAbstraction.

◆ write16()

virtual void EepromAbstraction::write16 ( EepromPosition  position,
uint16_t  val 
)
pure virtual

write a 16 bit value to the specified position

Parameters
positionthe position at which to write
valthe value to read

Implemented in MockEepromAbstraction, I2cAt24Eeprom, AvrEeprom, and ArduinoEEPROMAbstraction.

◆ read32()

virtual uint32_t EepromAbstraction::read32 ( EepromPosition  position)
pure virtual

read a 32 bit value at a specified position

Parameters
positionthe position at which to read

Implemented in MockEepromAbstraction, I2cAt24Eeprom, AvrEeprom, and ArduinoEEPROMAbstraction.

◆ write32()

virtual void EepromAbstraction::write32 ( EepromPosition  position,
uint32_t  val 
)
pure virtual

write a 32 bit value to position

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

Implemented in MockEepromAbstraction, I2cAt24Eeprom, AvrEeprom, and ArduinoEEPROMAbstraction.

◆ readIntoMemArray()

virtual void EepromAbstraction::readIntoMemArray ( uint8_t *  memDest,
EepromPosition  romSrc,
uint8_t  len 
)
pure virtual

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

Implemented in MockEepromAbstraction, I2cAt24Eeprom, ArduinoEEPROMAbstraction, and AvrEeprom.

◆ writeArrayToRom()

virtual void EepromAbstraction::writeArrayToRom ( EepromPosition  romDest,
const uint8_t *  memSrc,
uint8_t  len 
)
pure virtual

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

Implemented in MockEepromAbstraction, I2cAt24Eeprom, ArduinoEEPROMAbstraction, and AvrEeprom.


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