Olli Vanhoja / mFS
Embed: (wiki syntax)

« Back to documentation index

i2c_eeprom Class Reference

i2c_eeprom Class Reference

I2C EEPROM access class. More...

#include <i2c_eeprom.h>

Public Member Functions

 i2c_eeprom (int hwAddr, int speed)
 Initialize communication.
void write (char *data, uint16_t iAddr, unsigned int n)
 Write to I2C EEPROM.
void read (uint16_t iAddr, uint16_t n, char *out)
 Read from I2C EEPROM.

Detailed Description

I2C EEPROM access class.

This class is used for communication with I2C EEPROM chip.

Definition at line 29 of file i2c_eeprom.h.


Constructor & Destructor Documentation

i2c_eeprom ( int  hwAddr,
int  speed 
)

Initialize communication.

Parameters:
hwAddrHarware address of the I2C EEPROM chip.
speedI2C bus speed.

Definition at line 18 of file i2c_eeprom.cpp.


Member Function Documentation

void read ( uint16_t  iAddr,
uint16_t  n,
char *  out 
)

Read from I2C EEPROM.

Read any length of bytes from external EEPROM.

Parameters:
iAddrMemory address.
nRead n bytes.
*outReturns array of bytes.

Definition at line 71 of file i2c_eeprom.cpp.

void write ( char *  data,
uint16_t  iAddr,
unsigned int  n 
)

Write to I2C EEPROM.

Write any length of bytes to external EEPROM.

Parameters:
*dataArray of bytes.
iAddrMemory address.
nWrite n bytes.

Definition at line 28 of file i2c_eeprom.cpp.