+ def erase(self):
+ """Erase the target chip."""
+ self.writecmd(self.AVRAPP,0xF0,0,None);
+ def lockbits(self):
+ """Read the target's lockbits."""
+ self.writecmd(self.AVRAPP,0x82,0,None);
+ return ord(self.data[0]);
+ def setlockbits(self,bits=0x00):
+ """Read the target's lockbits."""
+ self.writecmd(self.AVRAPP,0x92,1,[bits]);
+ return self.lockbits();
+
+ def eeprompeek(self, adr):
+ """Read a byte of the target's EEPROM."""
+ self.writecmd(self.AVRAPP,0x81 ,2,
+ [ (adr&0xFF), (adr>>8)]
+ );#little-endian address
+ return ord(self.data[0]);
+ def flashpeek(self, adr):
+ """Read a byte of the target's EEPROM."""
+ self.writecmd(self.AVRAPP,0x02 ,2,
+ [ (adr&0xFF), (adr>>8)]
+ );#little-endian address
+ return ord(self.data[0]);
+ def flashpeekblock(self, adr):
+ """Read a byte of the target's EEPROM."""
+ self.writecmd(self.AVRAPP,0x02 ,4,
+ [ (adr&0xFF), (adr>>8) &0xFF, 0x80, 0x00]
+ );
+ return self.data;
+
+ def eeprompoke(self, adr, val):
+ """Write a byte of the target's EEPROM."""
+ self.writecmd(self.AVRAPP,0x91 ,3,
+ [ (adr&0xFF), (adr>>8), val]
+ );#little-endian address
+ return ord(self.data[0]);
+