uEEPROMLib
https://github.com/Naguissa/uEEPROMLib
Public Member Functions | Public Attributes | List of all members
uEEPROMLib Class Reference

I2C EEPROM library. Split from uRTCLib. More...

Public Member Functions

 uEEPROMLib ()
 Constructor.
 
 uEEPROMLib (const int)
 Constructor. More...
 
 uEEPROMLib (bool)
 Constructor. More...
 
 uEEPROMLib (bool, const int)
 Constructor. More...
 
void set_address (const uint8_t)
 Sets EEPROM i2c addres. More...
 
bool eeprom_read (const unsigned int, byte *, unsigned int)
 Read sequence of n bytes. More...
 
template<typename TR >
void eeprom_read (const unsigned int, TR *)
 Read any datatype from EEPROM address. More...
 
byte eeprom_read (const unsigned int)
 Read a byte from EEPROM address. More...
 
bool eeprom_write (const unsigned int, void *, const unsigned int)
 Write sequence of n bytes. More...
 
bool eeprom_write (const unsigned int, char)
 Write one byte to EEPROM address. More...
 
bool eeprom_write (const unsigned int, unsigned char)
 Write one byte to EEPROM address. More...
 
template<typename TW >
bool eeprom_write (const unsigned int, const TW)
 Write any datatype to EEPROM address. More...
 

Public Attributes

uint8_t page_size = 32
 : EEPROM page size control
 

Detailed Description

I2C EEPROM library. Split from uRTCLib.

This library controls any I2C EEPROM, independent ones or incorporated on DS1307 or DS3231 RTCs.

See also
https://github.com/Naguissa/uEEPROMLib
https://www.foroelectro.net/librerias-arduino-ide-f29/ueepromlib-arduino-libreria-simple-y-eficaz-para-e-t225.html
naguissa@foroelectro.net
https://github.com/Naguissa/uRTCLib
Version
1.2.1

Constructor & Destructor Documentation

◆ uEEPROMLib() [1/3]

uEEPROMLib::uEEPROMLib ( const int  addr)

Constructor.

Parameters
addrI2C address of EEPROM

◆ uEEPROMLib() [2/3]

uEEPROMLib::uEEPROMLib ( bool  skipInit)

Constructor.

Parameters
skipInitSet true to skip Wire.init (needed for STM32, SAM and Arduino, at least)

◆ uEEPROMLib() [3/3]

uEEPROMLib::uEEPROMLib ( bool  skipInit,
const int  addr 
)

Constructor.

Parameters
skipInitSet true to skip Wire.init (needed for STM32, SAM and Arduino, at least)
addrI2C address of EEPROM

Member Function Documentation

◆ eeprom_read() [1/3]

byte uEEPROMLib::eeprom_read ( const unsigned int  address)

Read a byte from EEPROM address.

Parameters
addressAddress inside EEPROM to read from
Returns
Read data

◆ eeprom_read() [2/3]

bool uEEPROMLib::eeprom_read ( const unsigned int  address,
byte *  data,
unsigned int  n 
)

Read sequence of n bytes.

Public function, can read any arbitrary data length

Parameters
addressAddress inside EEPROM to read from
dataPointer to where read data to
numberof bytes to read
Returns
true if bytes read are the same as requested

◆ eeprom_read() [3/3]

template<typename TR >
void uEEPROMLib::eeprom_read ( const unsigned int  address,
TR *  data 
)

Read any datatype from EEPROM address.

Parameters
addressAddress inside EEPROM to read from
Returns
read data (any type)

◆ eeprom_write() [1/4]

bool uEEPROMLib::eeprom_write ( const unsigned int  address,
char  data 
)

Write one byte to EEPROM address.

Parameters
addressAddress inside EEPROM to write to
datadata to write
Returns
true if successful

◆ eeprom_write() [2/4]

template<typename TW >
bool uEEPROMLib::eeprom_write ( const unsigned int  address,
const TW  data 
)

Write any datatype to EEPROM address.

Parameters
unsignedint

◆ eeprom_write() [3/4]

bool uEEPROMLib::eeprom_write ( const unsigned int  address,
unsigned char  data 
)

Write one byte to EEPROM address.

Parameters
addressAddress inside EEPROM to write to
datadata to write
Returns
true if successful

◆ eeprom_write() [4/4]

bool uEEPROMLib::eeprom_write ( const unsigned int  address,
void *  data,
const unsigned int  n = 0 
)

Write sequence of n bytes.

Parameters
addressinitial addesss to write to
datapointer to data to write (without offset)
nnumber of bytes to write
Returns
true if successful

◆ set_address()

void uEEPROMLib::set_address ( const uint8_t  addr)

Sets EEPROM i2c addres.

Parameters
skipInitSet true to skip Wire.init (needed for STM32, SAM and Arduino, at least)
addrI2C address of EEPROM

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