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-driver.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 37 of file EEPROM-driver.h.

#define EEPROM_PAGE_SIZE   128

Page for the AT24C512

Definition at line 40 of file EEPROM-driver.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 89 of file EEPROM-driver.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 61 of file EEPROM-driver.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 109 of file EEPROM-driver.h.


Variable Documentation

Array to hold I2C reply data

Definition at line 43 of file EEPROM-driver.h.

Array to hold I2C command data

Definition at line 42 of file EEPROM-driver.h.