com.dalsemi.system
Class DataPort

java.lang.Object
  |
  +--com.dalsemi.system.DataPort

public class DataPort
extends java.lang.Object

This class allows byte wide reads and writes to memory mapped IO.


Field Summary
static byte CE0
           
static byte CE1
           
static byte CE2
           
static byte CE3
           
 int latchValue
           
 int offset
           
static byte PCE0
           
static byte PCE1
           
static byte PCE2
           
static byte PCE3
           
static byte STRETCH10
           
static byte STRETCH11
           
static byte STRETCH12
           
static byte STRETCH2
           
static byte STRETCH3
           
static byte STRETCH4
           
static byte STRETCH5
           
static byte STRETCH9
           
 byte stretchCycles
           
 
Constructor Summary
DataPort(byte chipSelect)
          Create a DataPort object using the chip select specified.
 
Method Summary
 int getOffset()
          Get the offset for read/write.
 int getStretchCycles()
          Get the MOVX stretch cycles for read/write.
 int read()
          Read a single byte
 int read(byte[] arr, int off, int len)
          Read bytes into an array.
 int readLatch()
          Read the current latch value.
 void setOffset(int off)
          Set the offset for read/write.
 void setStretchCycles(byte stretch)
          Set the MOVX stretch cycles for read/write.
 void write(byte[] arr, int off, int len)
          Write an array of bytes.
 void write(int value)
          Write a single byte.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CE0

public static final byte CE0

CE1

public static final byte CE1

CE2

public static final byte CE2

CE3

public static final byte CE3

PCE0

public static final byte PCE0

PCE1

public static final byte PCE1

PCE2

public static final byte PCE2

PCE3

public static final byte PCE3

STRETCH2

public static final byte STRETCH2

STRETCH3

public static final byte STRETCH3

STRETCH4

public static final byte STRETCH4

STRETCH5

public static final byte STRETCH5

STRETCH9

public static final byte STRETCH9

STRETCH10

public static final byte STRETCH10

STRETCH11

public static final byte STRETCH11

STRETCH12

public static final byte STRETCH12

offset

public int offset

latchValue

public int latchValue

stretchCycles

public byte stretchCycles
Constructor Detail

DataPort

public DataPort(byte chipSelect)
Create a DataPort object using the chip select specified.
Parameters:
chipSelect - Descriptor of chip select to use.
See Also:
Method Detail

readLatch

public int readLatch()
Read the current latch value.
Returns:
latch value

read

public int read()
Read a single byte
Returns:
byte read

read

public int read(byte[] arr,
                int off,
                int len)
Read bytes into an array.
Parameters:
arr - Array of bytes
off - Starting offset to read into
len - Length to read
Returns:
number of bytes read

write

public void write(int value)
Write a single byte.
Parameters:
value - Single byte to write

write

public void write(byte[] arr,
                  int off,
                  int len)
Write an array of bytes.
Parameters:
arr - Array of bytes
off - Starting offset to send
len - Length to send

setOffset

public void setOffset(int off)
Set the offset for read/write.
Parameters:
off - Offset

getOffset

public int getOffset()
Get the offset for read/write.
Returns:
Offset.

setStretchCycles

public void setStretchCycles(byte stretch)
                      throws java.io.IOException
Set the MOVX stretch cycles for read/write.
Parameters:
stretch - Stretch cycle value.
Throws:
java.io.IOException - if stretch is out of range.

getStretchCycles

public int getStretchCycles()
Get the MOVX stretch cycles for read/write.
Returns:
Stretch cycle value.