EEPROMextent
Arduino EEPROM library
Public Member Functions | List of all members
EEPROMextentClass Class Reference

Main class for basic functions. More...

#include <EEPROMextent.h>

Public Member Functions

uint8_t readByte (int address)
 
void writeByte (int address, uint8_t value)
 
void updateByte (int address, uint8_t value)
 
template<class T >
int readAnything (int address, T &value)
 
template<class T >
int writeAnything (int address, const T &value)
 
template<class T >
int updateAnything (int address, const T &value)
 
char * readString (int address, char *outString, int inMaxLen)
 
int writeString (int address, const char *inString)
 
int updateString (int address, const char *inString)
 
void clear (int address, int inSize, byte inFillCharacter = 0)
 

Detailed Description

Main class for basic functions.

Member Function Documentation

void EEPROMextentClass::clear ( int  address,
int  inSize,
byte  inFillCharacter = 0 
)

Clear the content of the memory, starting from the given address for the given size. Clear means fill the memory with 0s, or with the given byte value.

Parameters
addressEEPROM address to begin to clear.
inSizesize of memory to clear.
inFillCharacterchracter to write in this memory area. 0 is the default.
template<class T >
int EEPROMextentClass::readAnything ( int  address,
T &  value 
)
inline

Read one object starting from the given address. The size of the object is automatically computed.

Parameters
addressEEPROM address to read.
valueobject to fill with the bytes loaded from EEPROM memory.
Returns
Number of bytes loaded.
See also
writeAnything()
updateAnything()
uint8_t EEPROMextentClass::readByte ( int  address)
inline

Read one byte from the given address.

Parameters
addressEEPROM address to read.
Returns
byte read at this address.
See also
writeByte()
updateByte()
char * EEPROMextentClass::readString ( int  address,
char *  outString,
int  inMaxLen 
)

Read a string starting from the given address, until its end of the maximum length given.

Parameters
addressEEPROM address to read.
outStringchar array to fill with the bytes loaded from EEPROM memory.
inMaxLenMaximum size of the string, which should be the size of the recepting buffer set in outString parameter.
Returns
Number of bytes loaded.
See also
writeString()
updateString()
template<class T >
int EEPROMextentClass::updateAnything ( int  address,
const T &  value 
)
inline

Update one object starting to the given address. The size of the object is automatically computed. Update each byte of the object starting at the given address. If the content of this address is already of this value, it does not write the byte. This function will be longer (read + write) if the byte have to be written, and faster (only read) if the content is already correct.

Parameters
addressEEPROM address to update.
valueobject to store at this address, for the size (
See also
sizeof()) of this object.
Returns
Number of bytes written.
See also
readAnything()
updateAnything()
void EEPROMextentClass::updateByte ( int  address,
uint8_t  value 
)
inline

Update one byte at the given address. If the content of this address is already of this value, it does not write the byte. This function will be longer (read + write) if the byte have to be written, and faster (only read) if the content is already correct.

Parameters
addressEEPROM address to write to.
valuenew value of this address.
See also
readByte()
updateByte()
int EEPROMextentClass::updateString ( int  address,
const char *  inString 
)

Update a string starting to the given address until its end. If the content of this address is already of this value, it does not write the byte. This function will be longer (read + write) if the byte have to be written, and faster (only read) if the content is already correct.

Parameters
addressEEPROM address to begin to update.
inStringchar array to store in EEPROM memory.
Returns
Number of bytes written.
See also
readString()
updateString()
template<class T >
int EEPROMextentClass::writeAnything ( int  address,
const T &  value 
)
inline

Write one object starting to the given address. The size of the object is automatically computed.

Parameters
addressEEPROM address to begin to write to.
valueobject to store at this address, for the size (with sizeof()) of this object.
Returns
Number of bytes written.
See also
readAnything()
updateAnything()
void EEPROMextentClass::writeByte ( int  address,
uint8_t  value 
)
inline

Write one byte to the given address.

Parameters
addressEEPROM address to write to.
valuenew value of this address.
See also
readByte()
updateByte()
int EEPROMextentClass::writeString ( int  address,
const char *  inString 
)

Write a string starting to the given address until its end.

Parameters
addressEEPROM address to begin to write to.
inStringchar array to store in EEPROM memory.
Returns
Number of bytes written.
See also
readString()
updateString()

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