I2C EEPROM library from 24C01 to 24C1025

Dependents:   Digitalni_Sat_MG_AN EEROM_1768 EEPROM_kamal EEPROM_MY ... more

Embed: (wiki syntax)

« Back to documentation index

EEPROM Class Reference

EEPROM Class Reference

EEPROM Class. More...

#include <eeprom.h>

Public Member Functions

 EEPROM (PinName sda, PinName scl, uint8_t address, TypeEeprom type)
 Constructor, initialize the eeprom on i2c interface.
void read (uint32_t address, int8_t &data)
 Random read byte.
void read (uint32_t address, int16_t &data)
 Random read short.
void read (uint32_t address, int32_t &data)
 Random read long.
void read (uint32_t address, float &data)
 Random read float.
void read (uint32_t address, void *data, uint32_t size)
 Random read anything.
void read (int8_t &data)
 Current address read byte.
void read (uint32_t address, int8_t *data, uint32_t size)
 Sequential read byte.
void write (uint32_t address, int8_t data)
 Write byte.
void write (uint32_t address, int16_t data)
 Write short.
void write (uint32_t address, int32_t data)
 Write long.
void write (uint32_t address, float data)
 Write float.
void write (uint32_t address, void *data, uint32_t size)
 Write anything (use the page write mode)
void write (uint32_t address, int8_t data[], uint32_t size)
 Write array of bytes (use the page mode)
void ready (void)
 Wait eeprom ready.
uint32_t getSize (void)
 Get eeprom size in bytes.
const char * getName (void)
 Get eeprom name.
void clear (void)
 Clear eeprom (write with 0)
uint8_t getError (void)
 Get the current error number (EEPROM_NoError if no error)
std::string getErrorMessage (void)
 Get current error message.

Detailed Description

EEPROM Class.

Definition at line 379 of file eeprom.h.


Constructor & Destructor Documentation

EEPROM ( PinName  sda,
PinName  scl,
uint8_t  address,
TypeEeprom  type 
)

Constructor, initialize the eeprom on i2c interface.

EEPROM(PinName sda, PinName scl, uint8_t address, TypeEeprom type) : _i2c(sda, scl)

Parameters:
sdasda i2c pin (PinName)
sclscl i2c pin (PinName)
addresseeprom address, according to eeprom type (uint8_t)
typeeeprom type (TypeEeprom)
Returns:
none

Constructor, initialize the eeprom on i2c interface.

Parameters:
sdasda i2c pin (PinName)
sclscl i2c pin (PinName)
addresseeprom address, according to eeprom type (uint8_t)
typeeeprom type (TypeEeprom)
Returns:
none

Definition at line 45 of file eeprom.cpp.


Member Function Documentation

void clear ( void   )

Clear eeprom (write with 0)

void clear(void)

Parameters:
none
Returns:
none

Clear eeprom (write with 0)

Parameters:
none
Returns:
none

Definition at line 882 of file eeprom.cpp.

uint8_t getError ( void   )

Get the current error number (EEPROM_NoError if no error)

uint8_t getError(void)

Parameters:
none
Returns:
none

Get the current error number (EEPROM_NoError if no error)

Parameters:
none
Returns:
none

Definition at line 996 of file eeprom.cpp.

std::string getErrorMessage ( void   )

Get current error message.

Parameters:
none
Returns:
current error message(std::string)

Definition at line 542 of file eeprom.h.

const char * getName ( void   )

Get eeprom name.

const char* getName(void)

Parameters:
none
Returns:
name (const char*)

Get eeprom name

Parameters:
none
Returns:
name (const char*)

Definition at line 943 of file eeprom.cpp.

uint32_t getSize ( void   )

Get eeprom size in bytes.

uint32_t getSize(void)

Parameters:
none
Returns:
size in bytes (uint32_t)

Get eeprom size in bytes

Parameters:
none
Returns:
size in bytes (uint32_t)

Definition at line 931 of file eeprom.cpp.

void read ( uint32_t  address,
int8_t *  data,
uint32_t  size 
)

Sequential read byte.

void read(uint32_t address, int8_t *data, uint32_t size)

Parameters:
addressstart address (uint32_t)
databytes array to read (int8_t[]&)
sizenumber of bytes to read (uint32_t)
Returns:
none

Sequential read byte

Parameters:
addressstart address (uint32_t)
databytes array to read (int8_t[]&)
sizenumber of bytes to read (uint32_t)
Returns:
none

Definition at line 661 of file eeprom.cpp.

void read ( uint32_t  address,
float &  data 
)

Random read float.

void read(uint32_t address, float& data)

Parameters:
addressstart address (uint32_t)
datafloat to read (float&)
Returns:
none

Random read float

Parameters:
addressstart address (uint32_t)
datafloat to read (float&)
Returns:
none

Definition at line 817 of file eeprom.cpp.

void read ( uint32_t  address,
int16_t &  data 
)

Random read short.

void read(uint32_t address, int16_t& data)

Parameters:
addressstart address (uint32_t)
datashort to read (int16_t&)
Returns:
none

Random read short

Parameters:
addressstart address (uint32_t)
datashort to read (int16_t&)
Returns:
none

Definition at line 761 of file eeprom.cpp.

void read ( uint32_t  address,
void *  data,
uint32_t  size 
)

Random read anything.

void read(uint32_t address, void *data, uint32_t size)

Parameters:
addressstart address (uint32_t)
datadata to read (void *)
sizenumber of bytes to read (uint32_t)
Returns:
none

Random read anything

Parameters:
addressstart address (uint32_t)
datadata to read (void *)
sizenumber of bytes to read (uint32_t)
Returns:
none

Definition at line 846 of file eeprom.cpp.

void read ( uint32_t  address,
int8_t &  data 
)

Random read byte.

void read(uint32_t address, int8_t& data)

Parameters:
addressstart address (uint32_t)
databyte to read (int8_t&)
Returns:
none

Random read byte

Parameters:
addressstart address (uint32_t)
databyte to read (int8_t&)
Returns:
none

Definition at line 594 of file eeprom.cpp.

void read ( int8_t &  data )

Current address read byte.

void read(int8_t& data)

Parameters:
databyte to read (int8_t&)
Returns:
none

Current address read byte

Parameters:
databyte to read (int8_t&)
Returns:
none

Definition at line 732 of file eeprom.cpp.

void read ( uint32_t  address,
int32_t &  data 
)

Random read long.

void read(uint32_t address, int32_t& data)

Parameters:
addressstart address (uint32_t)
datalong to read (int32_t&)
Returns:
none

Random read long

Parameters:
addressstart address (uint32_t)
datalong to read (int32_t&)
Returns:
none

Definition at line 789 of file eeprom.cpp.

void ready ( void   )

Wait eeprom ready.

void ready(void)

Parameters:
none
Returns:
none

Wait eeprom ready

Parameters:
none
Returns:
none

Definition at line 901 of file eeprom.cpp.

void write ( uint32_t  address,
int32_t  data 
)

Write long.

void write(uint32_t address, int32_t data)

Parameters:
addressstart address (uint32_t)
datalong to write (int32_t)
Returns:
none

Write long

Parameters:
addressstart address (uint32_t)
datalong to write (int32_t)
Returns:
none

Definition at line 501 of file eeprom.cpp.

void write ( uint32_t  address,
float  data 
)

Write float.

void write(uint32_t address, float data)

Parameters:
addressstart address (uint32_t)
datafloat to write (float)
Returns:
none

Write float

Parameters:
addressstart address (uint32_t)
datafloat to write (float)
Returns:
none

Definition at line 529 of file eeprom.cpp.

void write ( uint32_t  address,
int8_t  data[],
uint32_t  length 
)

Write array of bytes (use the page mode)

void write(uint32_t address, int8_t data[], uint32_t length)

Parameters:
addressstart address (uint32_t)
databytes array to write (int8_t[])
sizenumber of bytes to write (uint32_t)
Returns:
none

Write array of bytes (use the page mode)

Parameters:
addressstart address (uint32_t)
databytes array to write (int8_t[])
sizenumber of bytes to write (uint32_t)
Returns:
none

Definition at line 214 of file eeprom.cpp.

void write ( uint32_t  address,
void *  data,
uint32_t  size 
)

Write anything (use the page write mode)

void write(uint32_t address, void *data, uint32_t size)

Parameters:
addressstart address (uint32_t)
datadata to write (void *)
sizenumber of bytes to write (uint32_t)
Returns:
none

Write anything (use the page write mode)

Parameters:
addressstart address (uint32_t)
datadata to write (void *)
sizenumber of bytes to write (uint32_t)
Returns:
none

Definition at line 558 of file eeprom.cpp.

void write ( uint32_t  address,
int16_t  data 
)

Write short.

void write(uint32_t address, int16_t data)

Parameters:
addressstart address (uint32_t)
datashort to write (int16_t)
Returns:
none

Write short

Parameters:
addressstart address (uint32_t)
datashort to write (int16_t)
Returns:
none

Definition at line 473 of file eeprom.cpp.

void write ( uint32_t  address,
int8_t  data 
)

Write byte.

void write(uint32_t address, int8_t data)

Parameters:
addressstart address (uint32_t)
databyte to write (int8_t)
Returns:
none

Write byte

Parameters:
addressstart address (uint32_t)
databyte to write (int8_t)
Returns:
none

Definition at line 146 of file eeprom.cpp.