Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
EEPROM Class Reference
#include <EEPROM.h>
| Public Member Functions | |
| EEPROM (PinName sda, PinName scl, uint8_t address, TypeEeprom type) | |
| Constructor, initialize the eeprom on i2c interface. | |
| void | write_data (uint32_t address, void *data, uint32_t size) | 
| Write anything (use the page write mode) | |
| void | write_data_array (uint32_t address, uint8_t data[], uint32_t size) | 
| Write array of bytes (use the page mode) | |
| void | read_data (uint32_t address, void *data, uint32_t size) | 
| Random read anything. | |
| void | read_data_array (uint32_t address, uint8_t *data, uint32_t size) | 
| Sequential read byte. | |
| void | read_uint8_t (uint32_t address, uint8_t &data) | 
| Random read byte. | |
| uint8_t | read_uint8_t (uint32_t address) | 
| int8_t read(uint32_t address, int8_t) | |
| uint16_t | read_uint16_t (uint32_t address) | 
| Random read short. | |
| uint32_t | read_uint32_t (uint32_t address) | 
| Random read long. | |
| float | read_float (uint32_t address) | 
| Random read float. | |
| double | read_double (uint32_t address) | 
| Random read double. | |
| char * | read_string (uint32_t address) | 
| Random read string. | |
| void | read (uint8_t &data) | 
| Current address read byte. | |
| void | write_uint8_t (uint32_t address, uint8_t data) | 
| Write byte. | |
| void | write_uint16_t (uint32_t address, uint16_t data) | 
| Write short. | |
| void | write_uint32_t (uint32_t address, uint32_t data) | 
| Write long. | |
| void | write_float (uint32_t address, float data) | 
| Write float. | |
| void | write_double (uint32_t address, double data) | 
| Write double. | |
| void | write_string (uint32_t address, char *data) | 
| Write * data. | |
| 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 402 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:
- 
  sda sda i2c pin (PinName) scl scl i2c pin (PinName) address eeprom address, according to eeprom type (uint8_t) type eeprom type (TypeEeprom) 
- Returns:
- none
Constructor, initialize the eeprom on i2c interface.
- Parameters:
- 
  sda sda i2c pin (PinName) scl scl i2c pin (PinName) address eeprom address, according to eeprom type (uint8_t) type eeprom type (TypeEeprom) 
- Returns:
- none
Definition at line 52 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 1110 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 1219 of file EEPROM.cpp.
| std::string getErrorMessage | ( | void | ) | 
| 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 1166 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 1154 of file EEPROM.cpp.
| void read | ( | uint8_t & | data ) | 
Current address read byte.
void read(int8_t& data)
- Parameters:
- 
  data byte to read (int8_t&) 
- Returns:
- none
Current address read byte
- Parameters:
- 
  data byte to read (int8_t&) 
- Returns:
- none
Definition at line 881 of file EEPROM.cpp.
| void read_data | ( | uint32_t | address, | 
| void * | data, | ||
| uint32_t | size | ||
| ) | 
Random read anything.
void read(uint32_t address, void *data, uint32_t size)
- Parameters:
- 
  address start address (uint32_t) data data to read (void *) size number of bytes to read (uint32_t) 
- Returns:
- none
Random read anything
- Parameters:
- 
  address start address (uint32_t) data data to read (void *) size number of bytes to read (uint32_t) 
- Returns:
- none
Definition at line 429 of file EEPROM.cpp.
| void read_data_array | ( | uint32_t | address, | 
| uint8_t * | data, | ||
| uint32_t | size | ||
| ) | 
Sequential read byte.
void read(uint32_t address, int8_t *data, uint32_t size)
- Parameters:
- 
  address start address (uint32_t) data bytes array to read (int8_t[]&) size number of bytes to read (uint32_t) 
- Returns:
- none
Sequential read byte
- Parameters:
- 
  address start address (uint32_t) data bytes array to read (int8_t[]&) size number of bytes to read (uint32_t) 
- Returns:
- none
Definition at line 470 of file EEPROM.cpp.
| double read_double | ( | uint32_t | address ) | 
Random read double.
double read(uint32_t address)
- Parameters:
- 
  address start address (uint32_t) data double to read (double&) 
- Returns:
- double
Random read double
- Parameters:
- 
  address start address (uint32_t) 
- Returns:
- data double to read (double&)
Definition at line 1041 of file EEPROM.cpp.
| float read_float | ( | uint32_t | address ) | 
Random read float.
float read(uint32_t address)
- Parameters:
- 
  address start address (uint32_t) data float to read (float&) 
- Returns:
- float
Random read float
- Parameters:
- 
  address start address (uint32_t) 
- Returns:
- data float to read (float&)
Definition at line 1008 of file EEPROM.cpp.
| char * read_string | ( | uint32_t | address ) | 
Random read string.
double read_string(uint32_t address)
- Parameters:
- 
  address start address (uint32_t) data char * to read (char *) 
- Returns:
- char *
Random read char *
- Parameters:
- 
  address start address (uint32_t) 
- Returns:
- data char * to read (char *&)
Definition at line 1073 of file EEPROM.cpp.
| uint16_t read_uint16_t | ( | uint32_t | address ) | 
Random read short.
int16_t read(uint32_t address)
- Parameters:
- 
  address start address (uint32_t) data short to read (int16_t&) 
- Returns:
- none
Random read short
- Parameters:
- 
  address start address (uint32_t) 
- Returns:
- data short to read (int16_t&)
Definition at line 943 of file EEPROM.cpp.
| uint32_t read_uint32_t | ( | uint32_t | address ) | 
Random read long.
int32_t read(uint32_t address)
- Parameters:
- 
  address start address (uint32_t) data long to read (int32_t&) 
- Returns:
- uint32_t
Random read long
- Parameters:
- 
  address start address (uint32_t) 
- Returns:
- data long to read (int32_t&)
Definition at line 975 of file EEPROM.cpp.
| void read_uint8_t | ( | uint32_t | address, | 
| uint8_t & | data | ||
| ) | 
Random read byte.
void read(uint32_t address, int8_t& data)
- Parameters:
- 
  address start address (uint32_t) data byte to read (int8_t&) 
- Returns:
- none
Random read byte
- Parameters:
- 
  address start address (uint32_t) data byte to read (int8_t&) 
- Returns:
- none
Definition at line 813 of file EEPROM.cpp.
| uint8_t read_uint8_t | ( | uint32_t | address ) | 
int8_t read(uint32_t address, int8_t)
Random read byte
- Parameters:
- 
  address start address (uint32_t) 
- Returns:
- data byte to read (int8_t&)
Definition at line 911 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 1124 of file EEPROM.cpp.
| void write_data | ( | 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:
- 
  address start address (uint32_t) data data to write (void *) size number of bytes to write (uint32_t) 
- Returns:
- none
Write anything (use the page write mode)
- Parameters:
- 
  address start address (uint32_t) data data to write (void *) size number of bytes to write (uint32_t) 
- Returns:
- none
Definition at line 547 of file EEPROM.cpp.
| void write_data_array | ( | uint32_t | address, | 
| uint8_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:
- 
  address start address (uint32_t) data bytes array to write (int8_t[]) size number of bytes to write (uint32_t) 
- Returns:
- none
Write array of bytes (use the page mode)
- Parameters:
- 
  address start address (uint32_t) data bytes array to write (int8_t[]) size number of bytes to write (uint32_t) 
- Returns:
- none
Definition at line 156 of file EEPROM.cpp.
| void write_double | ( | uint32_t | address, | 
| double | data | ||
| ) | 
Write double.
void write_double(uint32_t address, double data)
- Parameters:
- 
  address start address (uint32_t) data double to write (double) 
- Returns:
- none
Write double
- Parameters:
- 
  address start address (uint32_t) data double to write (double) 
- Returns:
- none
Definition at line 750 of file EEPROM.cpp.
| void write_float | ( | uint32_t | address, | 
| float | data | ||
| ) | 
Write float.
void write_float(uint32_t address, float data)
- Parameters:
- 
  address start address (uint32_t) data float to write (float) 
- Returns:
- none
Write float
- Parameters:
- 
  address start address (uint32_t) data float to write (float) 
- Returns:
- none
Definition at line 719 of file EEPROM.cpp.
| void write_string | ( | uint32_t | address, | 
| char * | data | ||
| ) | 
Write * data.
void write_string(uint32_t address, char * data)
- Parameters:
- 
  address start address (uint32_t) data * data to write (* data) 
- Returns:
- none
Write char *
- Parameters:
- 
  address start address (uint32_t) data char * to write (char *) 
- Returns:
- none
Definition at line 781 of file EEPROM.cpp.
| void write_uint16_t | ( | uint32_t | address, | 
| uint16_t | data | ||
| ) | 
Write short.
void write_uint16_t(uint32_t address, int16_t data)
- Parameters:
- 
  address start address (uint32_t) data short to write (int16_t) 
- Returns:
- none
Write short
- Parameters:
- 
  address start address (uint32_t) data short to write (int16_t) 
- Returns:
- none
Definition at line 657 of file EEPROM.cpp.
| void write_uint32_t | ( | uint32_t | address, | 
| uint32_t | data | ||
| ) | 
Write long.
void write_uint32_t(uint32_t address, int32_t data)
- Parameters:
- 
  address start address (uint32_t) data long to write (int32_t) 
- Returns:
- none
Write long
- Parameters:
- 
  address start address (uint32_t) data long to write (int32_t) 
- Returns:
- none
Definition at line 688 of file EEPROM.cpp.
| void write_uint8_t | ( | uint32_t | address, | 
| uint8_t | data | ||
| ) | 
Write byte.
void write_uint8_t(uint32_t address, int8_t data)
- Parameters:
- 
  address start address (uint32_t) data byte to write (int8_t) 
- Returns:
- none
Write byte
- Parameters:
- 
  address start address (uint32_t) data byte to write (int8_t) 
- Returns:
- none
Definition at line 586 of file EEPROM.cpp.
Generated on Fri Jul 15 2022 02:08:33 by
 1.7.2
 1.7.2