EEPROMClass class.
More...
#include <EEPROM.h>
|
| 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.
|
| |
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.
◆ 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
-
- Parameters
-
| idx | Index of the first EEPROM cell to read. |
| t | Object 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
-
| idx | Index 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
-
- Parameters
-
| idx | Index of the first EEPROM cell to write. |
| t | Object to write. |
- Returns
- Reference to t.
◆ read()
| uint8_t EEPROMClass::read |
( |
int |
idx | ) |
|
|
inline |
Read a byte from EEPROM.
- Parameters
-
| idx | Index 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
-
| idx | Index of the EEPROM cell. |
| val | Value to write. |
◆ write()
| void EEPROMClass::write |
( |
int |
idx, |
|
|
uint8_t |
val |
|
) |
| |
|
inline |
Write a byte to EEPROM.
- Parameters
-
| idx | Index of the EEPROM cell. |
| val | Value to write. |
The documentation for this struct was generated from the following file:
- libraries/EEPROM/src/EEPROM.h