RoboJDETM v2.0

com.ridgesoft.io
Class EEPROM

java.lang.Object
  extended by com.ridgesoft.io.EEPROM
Direct Known Subclasses:
I2CEEPROM

public abstract class EEPROM
extends Object

Abstract class to interface to an EEPROM.


Constructor Summary
protected EEPROM()
          Constructor for sub-classes to use.
 
Method Summary
 void read(int address, byte[] buffer)
          Reads an array of bytes from the EEPROM.
 void read(int address, byte[] buffer, int offset, int count)
          Reads an array of bytes from the EEPROM.
abstract  byte readByte(int address)
          Reads a byte of data from the EEPROM.
 int readInt(int address)
          Reads an int value from the EEPROM.
 short readShort(int address)
          Reads a short value from the EEPROM.
abstract  int size()
          Returns the accessible size of the EEPROM in bytes.
abstract  void write(int address, byte value)
          Writes a byte into the EEPROM.
 void write(int address, byte[] buffer)
          Writes a byte array into the EEPROM.
 void write(int address, byte[] buffer, int offset, int count)
          Writes data from a byte array into the EEPROM.
 void write(int address, int value)
          Writes an int into the EEPROM.
 void write(int address, short value)
          Writes a short into the EEPROM.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

EEPROM

protected EEPROM()
Constructor for sub-classes to use.

Method Detail

read

public void read(int address,
                 byte[] buffer)
          throws IOException
Reads an array of bytes from the EEPROM.

Parameters:
address - address to read
buffer - buffer to fill with bytes read from the EEPROM
Throws:
IOException

read

public void read(int address,
                 byte[] buffer,
                 int offset,
                 int count)
          throws IOException
Reads an array of bytes from the EEPROM.

Parameters:
address - address to read
buffer - buffer to fill with bytes read from the EEPROM
offset - offset of first location in buffer to fill
count - number of bytes to read
Throws:
IOException

readByte

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

Parameters:
address - address to read
Returns:
byte of EEPROM data
Throws:
IOException

readInt

public int readInt(int address)
            throws IOException
Reads an int value from the EEPROM.

Parameters:
address - address to read
Returns:
int value from EEPROM
Throws:
IOException

readShort

public short readShort(int address)
                throws IOException
Reads a short value from the EEPROM.

Parameters:
address - address to read
Returns:
short value from EEPROM
Throws:
IOException

size

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

Returns:
size of EEPROM in bytes

write

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

Parameters:
address - address to write
value - value to write
Throws:
IOException

write

public void write(int address,
                  byte[] buffer)
           throws IOException
Writes a byte array into the EEPROM.

Parameters:
address - address to write
buffer - buffer of data to write
Throws:
IOException

write

public void write(int address,
                  byte[] buffer,
                  int offset,
                  int count)
           throws IOException
Writes data from a byte array into the EEPROM.

Parameters:
address - address to write
buffer - byte array containing the data to write
offset - offset to the first byte in the buffer to write
count - the number of bytes to write
Throws:
IOException

write

public void write(int address,
                  int value)
           throws IOException
Writes an int into the EEPROM.

Parameters:
address - address to write
value - value to write
Throws:
IOException

write

public void write(int address,
                  short value)
           throws IOException
Writes a short into the 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