1 import os, struct, sys, time
3 from serial import Serial
8 def programChip(self, flashData):
10 self.chip = chipDB.getChipFromDB(self.getSignature())
11 if self.chip == False:
12 raise IspError("Chip with signature: " + str(self.getSignature()) + "not found")
15 print("Flashing %i bytes" % len(flashData))
16 self.writeFlash(flashData)
17 print("Verifying %i bytes" % len(flashData))
18 self.verifyFlash(flashData)
20 #low level ISP commands
21 def getSignature(self):
23 sig.append(self.sendISP([0x30, 0x00, 0x00, 0x00])[3])
24 sig.append(self.sendISP([0x30, 0x00, 0x01, 0x00])[3])
25 sig.append(self.sendISP([0x30, 0x00, 0x02, 0x00])[3])
29 self.sendISP([0xAC, 0x80, 0x00, 0x00])
32 def __init__(self, value):
35 return repr(self.value)