From faa643bbc09dff311496b0d6597df00ac68a2323 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Mon, 1 Feb 2010 01:09:26 +0100 Subject: implement chip callback stubs Signed-off-by: Michael Buesch --- toprammer | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'toprammer') 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) -- cgit v1.2.3