summaryrefslogtreecommitdiffstats
path: root/toprammer
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2010-02-01 01:09:26 +0100
committerMichael Buesch <mb@bu3sch.de>2010-02-01 01:09:26 +0100
commitfaa643bbc09dff311496b0d6597df00ac68a2323 (patch)
tree671cc911a32e21513cc8d17f02b4a7db33c7b30a /toprammer
parenta075190d411b6410cceeddffb10b01d7a177f786 (diff)
downloadtoprammer-faa643bbc09dff311496b0d6597df00ac68a2323.tar.xz
toprammer-faa643bbc09dff311496b0d6597df00ac68a2323.zip
implement chip callback stubs
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'toprammer')
-rwxr-xr-xtoprammer38
1 files changed, 38 insertions, 0 deletions
diff --git a/toprammer b/toprammer
index cb9e4e5..7a4e63e 100755
--- a/toprammer
+++ b/toprammer
@@ -192,6 +192,18 @@ class TOP:
for i in range(0, len(data), 60):
self.cmdFPGAUploadConfig(data[i : i + 60])
+ def readSignature(self):
+ """Reads the device signature and returns it."""
+ self.printDebug("Reading signature from chip...")
+ sig = self.chip.readSignature()
+ self.printDebug("Done reading %d bytes." % len(sig))
+ return sig
+
+ def eraseChip(self):
+ """Erase the chip."""
+ self.printDebug("Erasing chip...")
+ self.chip.erase()
+
def readProgmem(self):
"""Reads the program memory image and returns it."""
self.printDebug("Reading program memory from chip...")
@@ -205,6 +217,32 @@ class TOP:
self.chip.writeProgmem(image)
self.printDebug("Done writing image.")
+ def readEEPROM(self):
+ """Reads the EEPROM image and returns it."""
+ self.printDebug("Reading EEPROM from chip...")
+ image = self.chip.readEEPROM()
+ self.printDebug("Done reading %d bytes." % len(image))
+ return image
+
+ def writeEEPROM(self, image):
+ """Writes an EEPROM image to the chip."""
+ self.printDebug("Writing %d bytes of EEPROM to chip..." % len(image))
+ self.chip.writeEEPROM(image)
+ self.printDebug("Done writing image.")
+
+ def readFuse(self):
+ """Reads the fuses image and returns it."""
+ self.printDebug("Reading fuses from chip...")
+ image = self.chip.readFuse()
+ self.printDebug("Done reading %d bytes." % len(image))
+ return image
+
+ def writeFuse(self, image):
+ """Writes a fuses image to the chip."""
+ self.printDebug("Writing %d bytes of fuses to chip..." % len(image))
+ self.chip.writeFuse(image)
+ self.printDebug("Done writing image.")
+
def cmdFlush(self, count=1):
"""Send 'count' flush requests."""
assert(count >= 1)
bues.ch cgit interface