|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.wagner_ibw.iow.spi.AbstractSPIDevice | +--de.wagner_ibw.iow.spi.M95020
Implemenation of the M95020 (2Kbit EEPROM) spi device. Tested successfully with 1MBit/sec spi SCK.
Field Summary | |
static int |
CMD_RDSR
Instruction "Read Status Register". |
static int |
CMD_READ
Instruction "Read to Memory Array". |
static int |
CMD_WRDI
Instruction "Write Disable". |
static int |
CMD_WREN
Instruction "Write Enable". |
static int |
CMD_WRITE
Instruction "Write to Memory Array". |
static int |
CMD_WRSR
Instruction "Write Status Register". |
int |
EEPROM_SIZE
Capacity of this EEPROM in byte. |
static int |
FLAGS
Prefered SPI special mode function flags for this device. |
int |
MAX_PAGE_SIZE
Maximum page size for block write operations. |
static java.lang.String |
NAME
M95020 device specific constants. |
Constructor Summary | |
M95020()
Constructor. |
Method Summary | |
void |
fillEeprom(int pattern)
Fills the whole eeprom with the specified pattern. |
int |
read(int address)
Reads Memory Array at the specified address. |
int[] |
readPage(int address,
int length)
Reads more than one value from the Memory array. |
int |
readStatusReg()
Reads the eeprom's status register. |
void |
write(int address,
int data)
Writes Memory Array at the specified address. |
void |
writeDisable()
Disables write operations. |
void |
writeEnable()
Enables write operations. |
void |
writePage(int address,
int[] data)
Writes more than one value to the Memory array. |
void |
writeStatusReg(int statusRegister)
Writes a new value to the eeprom's status register. |
Methods inherited from class de.wagner_ibw.iow.spi.AbstractSPIDevice |
getName, reportReceived, setIowDevice, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String NAME
public final int MAX_PAGE_SIZE
public final int EEPROM_SIZE
public static final int CMD_WREN
public static final int CMD_WRDI
public static final int CMD_RDSR
public static final int CMD_WRSR
public static final int CMD_READ
public static final int CMD_WRITE
public static final int FLAGS
Constructor Detail |
public M95020()
Method Detail |
public void writeEnable() throws java.lang.Exception
java.lang.Exception
- If any transmission error occurred.public void writeDisable() throws java.lang.Exception
java.lang.Exception
- If any transmission error occurred.public int read(int address) throws java.lang.Exception
address
- Read address.
java.lang.Exception
- If any transmission error occurred.
java.lang.IllegalArgumentException
- If address is invalid.public void write(int address, int data) throws java.lang.Exception, java.lang.IllegalArgumentException
address
- Write address.data
- Value to write.
java.lang.Exception
- If any transmission error occurred.
java.lang.IllegalArgumentException
- If address is invalid.public void writePage(int address, int[] data) throws java.lang.Exception, java.lang.IllegalArgumentException
address
- Start write address.data
- Array of values to write.
java.lang.Exception
- If any transmission error occurred.
java.lang.IllegalArgumentException
- If address is invalid
or if array size is out of range (1...MAX_PAGE_SIZE).public int[] readPage(int address, int length) throws java.lang.Exception, java.lang.IllegalArgumentException
address
- Start read address.length
- How many values to read.
java.lang.Exception
- If any transmission error occurred.
java.lang.IllegalArgumentException
- If address is invalid.public void writeStatusReg(int statusRegister) throws java.lang.Exception
statusRegister
- New value for the register.
java.lang.Exception
- If any transmission error occurred.public int readStatusReg() throws java.lang.Exception
java.lang.Exception
- If any transmission error occurred.public void fillEeprom(int pattern) throws java.lang.Exception
pattern
- Pattern that fills the eeprom.
java.lang.Exception
- If any transmission error occurred.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |