RoboJDETM v2.0

com.ridgesoft.robotics
Class I2CEEPROM

java.lang.Object
  extended by com.ridgesoft.io.EEPROM
      extended by com.ridgesoft.robotics.I2CEEPROM

public class I2CEEPROM
extends EEPROM

Class to interface to and I2C EEPROM.


Constructor Summary
I2CEEPROM(I2CMaster i2cMaster, int i2cAddress, int size, int writeDelay)
          Constructs an I2CEEPROM object.
 
Method Summary
 byte readByte(int address)
          Reads a byte of data from the EEPROM.
 int size()
          Returns the accessible size of the EEPROM in bytes.
 void write(int address, byte value)
          Writes a byte into EEPROM memory.
 
Methods inherited from class com.ridgesoft.io.EEPROM
read, read, readInt, readShort, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

I2CEEPROM

public I2CEEPROM(I2CMaster i2cMaster,
                 int i2cAddress,
                 int size,
                 int writeDelay)
Constructs an I2CEEPROM object.

Parameters:
i2cMaster - reference to the I2CMaster object for the bus this device is on
i2cAddress - I2C address for this device
size - number of bytes the device holds
writeDelay - milliseconds to delay after a write - calling thread sleeps during this time
Method Detail

readByte

public byte readByte(int address)
              throws IOException
Reads a byte of data from the EEPROM.

Specified by:
readByte in class EEPROM
Parameters:
address - address to read
Returns:
byte of EEPROM data
Throws:
IOException

size

public int size()
Returns the accessible size of the EEPROM in bytes.

Specified by:
size in class EEPROM
Returns:
size of EEPROM in bytes

write

public void write(int address,
                  byte value)
           throws IOException
Writes a byte into EEPROM memory.

Specified by:
write in class EEPROM
Parameters:
address - address to write
value - value to write
Throws:
IOException

RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com