STM32 core 3.0.1-dev
Arduino core for STM32 based boards: API reference
← STM32duino documentation
Loading...
Searching...
No Matches
EEPROMClass Struct Reference

EEPROMClass class. More...

#include <EEPROM.h>

Public Member Functions

EERef operator[] (const int idx)
 Access the EEPROM cell at an index.
 
uint8_t read (int idx)
 Read a byte from EEPROM.
 
void write (int idx, uint8_t val)
 Write a byte to EEPROM.
 
void update (int idx, uint8_t val)
 Write a byte to EEPROM only if it differs from the stored value, to reduce EEPROM wear.
 
EEPtr begin ()
 Get an iterator to the first EEPROM cell (STL and C++11 iteration).
 
EEPtr end ()
 Get an iterator to the item after the last EEPROM cell (STL and C++11 iteration).
 
uint16_t length ()
 Get the number of EEPROM bytes available.
 
template<typename T >
T & get (int idx, T &t)
 Read an object from EEPROM.
 
template<typename T >
const T & put (int idx, const T &t)
 Write an object to EEPROM.
 

Detailed Description

EEPROMClass class.

This object represents the entire EEPROM space. It wraps the functionality of EEPtr and EERef into a basic interface. This class is also 100% backwards compatible with earlier Arduino core releases.

Member Function Documentation

◆ begin()

EEPtr EEPROMClass::begin ( )
inline

Get an iterator to the first EEPROM cell (STL and C++11 iteration).

Returns
EEPtr pointing to index 0.

◆ end()

EEPtr EEPROMClass::end ( )
inline

Get an iterator to the item after the last EEPROM cell (STL and C++11 iteration).

Returns
EEPtr pointing past the last valid cell, it must not be dereferenced.

◆ get()

template<typename T >
T & EEPROMClass::get ( int  idx,
T &  t 
)
inline

Read an object from EEPROM.

Template Parameters
TType of the object.
Parameters
idxIndex of the first EEPROM cell to read.
tObject to fill with the values read from EEPROM.
Returns
Reference to t.

◆ length()

uint16_t EEPROMClass::length ( )
inline

Get the number of EEPROM bytes available.

Returns
Size of the EEPROM in bytes, 0 when USE_HALV2_DRIVER is defined.

◆ operator[]()

EERef EEPROMClass::operator[] ( const int  idx)
inline

Access the EEPROM cell at an index.

Parameters
idxIndex of the EEPROM cell.
Returns
EERef referencing the EEPROM cell.

◆ put()

template<typename T >
const T & EEPROMClass::put ( int  idx,
const T &  t 
)
inline

Write an object to EEPROM.

Only the bytes that differ from the stored values are written.

Template Parameters
TType of the object.
Parameters
idxIndex of the first EEPROM cell to write.
tObject to write.
Returns
Reference to t.

◆ read()

uint8_t EEPROMClass::read ( int  idx)
inline

Read a byte from EEPROM.

Parameters
idxIndex of the EEPROM cell.
Returns
Value stored in the EEPROM cell.

◆ update()

void EEPROMClass::update ( int  idx,
uint8_t  val 
)
inline

Write a byte to EEPROM only if it differs from the stored value, to reduce EEPROM wear.

Parameters
idxIndex of the EEPROM cell.
valValue to write.

◆ write()

void EEPROMClass::write ( int  idx,
uint8_t  val 
)
inline

Write a byte to EEPROM.

Parameters
idxIndex of the EEPROM cell.
valValue to write.

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