def getClient(name="GoodFET"):
import GoodFET, GoodFETCC, GoodFETAVR, GoodFETSPI, GoodFETMSP430, GoodFETNRF;
if(name=="GoodFET" or name=="monitor"): return GoodFET.GoodFET();
def getClient(name="GoodFET"):
import GoodFET, GoodFETCC, GoodFETAVR, GoodFETSPI, GoodFETMSP430, GoodFETNRF;
if(name=="GoodFET" or name=="monitor"): return GoodFET.GoodFET();
elif name=="avr": return GoodFETAVR.GoodFETAVR();
elif name=="spi": return GoodFETSPI.GoodFETSPI();
elif name=="msp430": return GoodFETMSP430.GoodFETMSP430();
elif name=="avr": return GoodFETAVR.GoodFETAVR();
elif name=="spi": return GoodFETSPI.GoodFETSPI();
elif name=="msp430": return GoodFETMSP430.GoodFETMSP430();
"""Time the execution of a verb."""
if data==None: data=[];
self.data=[app&0xff, verb&0xFF]+data;
"""Time the execution of a verb."""
if data==None: data=[];
self.data=[app&0xff, verb&0xFF]+data;
self.writecmd(self.GLITCHAPP,0x82,len(self.data),self.data);
self.writecmd(self.GLITCHAPP,0x82,len(self.data),self.data);
def glitchVoltages(self,low=0x0880, high=0x0fff):
"""Set glitching voltages. (0x0fff is max.)"""
self.data=[low&0xff, (low>>8)&0xff,
def glitchVoltages(self,low=0x0880, high=0x0fff):
"""Set glitching voltages. (0x0fff is max.)"""
self.data=[low&0xff, (low>>8)&0xff,
def peek(self,address):
"""Read a word of memory from the monitor."""
return self.peekbyte(address)+(self.peekbyte(address+1)<<8);
def peek(self,address):
"""Read a word of memory from the monitor."""
return self.peekbyte(address)+(self.peekbyte(address+1)<<8);
def pokebyte(self,address,value):
"""Set a byte of memory by the monitor."""
self.data=[address&0xff,address>>8,value];
self.writecmd(0,0x03,3,self.data);
return ord(self.data[0]);
def pokebyte(self,address,value):
"""Set a byte of memory by the monitor."""
self.data=[address&0xff,address>>8,value];
self.writecmd(0,0x03,3,self.data);
return ord(self.data[0]);
+ def setsecret(self,value):
+ """Set a secret word for later retreival. Used by glitcher."""
+ self.eeprompoke(0,value);
+ self.eeprompoke(1,value);
+ def getsecret(self):
+ """Get a secret word. Used by glitcher."""
+ self.eeprompeek(0);
+