|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.system.DataPort
This class allows byte wide reads and writes to memory mapped IO devices.
Two modes are available: Sequential and FIFO (First In First Out). Sequential
mode is the default and automatically increments the address after each byte
when block reads and writes occur. FIFO access only writes to the specified
address, and does not increment the address during block reads and writes.
setFIFOMode
should be called to set the appropriate mode.
After each read
or write
call, the memory address
is returned to the start address designated by setAddress
.
For slower memory devices, the use of stretch cycles access may be needed.
Set this parameter via setStretchCycles
.
Eight chip enables are available, CE0-CE3, PCE0-PCE3.
The memory map is divided into two segments.
CE decoded address space spans from 0 - 4MB: 0x00000000 - 0x003FFFFF
PCE decoded address space spans from 8MB - 12MB: 0x00800000 - 0x00BFFFFF
Expected Transfer Speeds | |
Function | Speed (bytes/s) |
to CE Sequential | 655000 |
to PCE Sequential | 172000 |
to CE FIFO | 655000 |
to PCE FIFO | 172000 |
single byte only | 770 |
Field Summary | |
int |
address
Starting memory address for mapped IO access. |
int |
latchValue
The last written value. |
static byte |
STRETCH0
Use to set the number of memory bus cycles to 2. |
static byte |
STRETCH1
Use to set the number of memory bus cycles to 3. |
static byte |
STRETCH10
Use to set the number of memory bus cycles to 12. |
static byte |
STRETCH2
Use to set the number of memory bus cycles to 4. |
static byte |
STRETCH3
Use to set the number of memory bus cycles to 5. |
static byte |
STRETCH7
Use to set the number of memory bus cycles to 9. |
static byte |
STRETCH8
Use to set the number of memory bus cycles to 10. |
static byte |
STRETCH9
Use to set the number of memory bus cycles to 11. |
byte |
stretchCycles
Number of stretch memory cycles to use when accessing memory mapped IO. |
boolean |
useFIFOAccess
Set to true to access FIFO type devices. |
Constructor Summary | |
DataPort()
Creates a DataPort object with address of 0x000000. |
|
DataPort(int address)
Creates a DataPort object using the address specified. |
Method Summary | |
int |
getAddress()
Gets the starting address for read/write. |
boolean |
getFIFOMode()
Gets the FIFO mode. |
int |
getStretchCycles()
Gets the number of stretch memory cycles to use when accessing memory mapped IO. |
int |
read()
Reads a single byte from the address . |
int |
read(byte[] arr,
int off,
int len)
Reads bytes into an array starting at the address . |
int |
readLatch()
Reads the current latch value. |
void |
setAddress(int address)
Sets the starting address for read/write. |
void |
setFIFOMode(boolean useFIFOAccess)
Sets/Clears the FIFO mode. |
void |
setStretchCycles(byte stretch)
Sets the number of stretch memory cycles to use when accessing memory mapped IO. |
void |
write(byte[] arr,
int off,
int len)
Writes an array of bytes starting at the address . |
void |
write(int value)
Writes a single byte to the address . |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final byte STRETCH0
public static final byte STRETCH1
public static final byte STRETCH2
public static final byte STRETCH3
public static final byte STRETCH7
public static final byte STRETCH8
public static final byte STRETCH9
public static final byte STRETCH10
public int address
public boolean useFIFOAccess
true
to access FIFO type devices.public int latchValue
public byte stretchCycles
STRETCH0
STRETCH1
STRETCH2
STRETCH3
STRETCH7
STRETCH8
STRETCH9
STRETCH10
Constructor Detail |
public DataPort()
public DataPort(int address)
address
- address location for read/write.Method Detail |
public int readLatch()
read
method.public int read() throws IllegalAddressException
address
.address
is out of rangepublic int read(byte[] arr, int off, int len) throws IllegalAddressException
address
.arr
- array of bytesoff
- starting offset to read intolen
- length to readaddress
is out of rangepublic void write(int value) throws IllegalAddressException
address
.value
- single byte to writeaddress
is out of rangepublic void write(byte[] arr, int off, int len) throws IllegalAddressException
address
.arr
- array of bytesoff
- starting offset to sendlen
- length to sendaddress
is out of rangepublic void setAddress(int address)
address
- address for read/writepublic int getAddress()
public void setFIFOMode(boolean useFIFOAccess)
useFIFOAddress
- false
for automatic incrementing of address during
multiple reads, or true
for FIFO style non-incrementing addressingpublic boolean getFIFOMode()
true
if using FIFO mode, false
if using sequential modepublic void setStretchCycles(byte stretch) throws IllegalArgumentException
STRETCH0
STRETCH1
STRETCH2
STRETCH3
STRETCH7
STRETCH8
STRETCH9
STRETCH10
stretch
- stretch cycle valuepublic int getStretchCycles()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |