Mindstorms 3rd Party ROBOTC Drivers RobotC
[Home] [Download] [Submit a bug/suggestion] [ROBOTC Forums] [Blog] [Support this project]
Files | Defines | Functions | Variables

Generic I2C EEPROM
[Other]

Files

file  eeprom.h
 

RobotC EEPROM Driver.


Defines

#define EEPROM_I2C_ADDR   0xA0
#define EEPROM_PAGE_SIZE   128

Functions

bool EEPROMreadBytes (tSensors link, long address, tByteArray &data, int numbytes)
bool EEPROMwriteBytes (tSensors link, long address, tByteArray &data, int numbytes)
bool _EEPROMwriteDummy (tSensors link, long address)

Variables

tByteArray EEPROM_I2CRequest
tByteArray EEPROM_I2CReply

Detailed Description

Generic I2C EEPROM


Define Documentation

#define EEPROM_I2C_ADDR   0xA0

EEPROM I2C device address

Definition at line 38 of file eeprom.h.

#define EEPROM_PAGE_SIZE   128

Page for the AT24C512

Definition at line 41 of file eeprom.h.


Function Documentation

bool _EEPROMwriteDummy ( tSensors  link,
long  address 
)

Perform a dummy write to set address for next read

Note: this is an internal function and should not be called directly.

Parameters:
linkthe EEPROM
addressthe address to set
Returns:
true if no error occured, false if it did

Definition at line 87 of file eeprom.h.

bool EEPROMreadBytes ( tSensors  link,
long  address,
tByteArray data,
int  numbytes 
)

Read a number of bytes from address

Parameters:
linkthe EEPROM
addressthe address to read from
datathe byte array to store read result in
numbytesthe number of bytes to read (limited to 16 at a time)
Returns:
true if no error occured, false if it did
Examples:
eeprom-test1.c, and eeprom-test2.c.

Definition at line 62 of file eeprom.h.

bool EEPROMwriteBytes ( tSensors  link,
long  address,
tByteArray data,
int  numbytes 
)

Write a single byte to address

Parameters:
linkthe EEPROM
addressthe address to write to
datathe byte array to write
numbytesthe number of bytes to write (limited to 13 at a time)
Returns:
true if no error occured, false if it did
Examples:
eeprom-test1.c, and eeprom-test2.c.

Definition at line 107 of file eeprom.h.


Variable Documentation

Array to hold I2C reply data

Definition at line 44 of file eeprom.h.

Array to hold I2C command data

Definition at line 43 of file eeprom.h.