X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETCC.py;h=3f4d1d91e79391be62dfce970550484b267b9ae8;hp=d5208bd2dccf01f0f90430465fad8589ee86f8b1;hb=c9fa78dd91736cd5004d23fd9535c30be4f978ff;hpb=f1803b3ed1a5bd2673fb14c1f023940355cb4254 diff --git a/client/GoodFETCC.py b/client/GoodFETCC.py index d5208bd..3f4d1d9 100644 --- a/client/GoodFETCC.py +++ b/client/GoodFETCC.py @@ -53,7 +53,7 @@ class GoodFETCC(GoodFET): self.CCstop(); print "Done."; - def CCsetup(self): + def setup(self): """Move the FET into the CC2430/CC2530 application.""" #print "Initializing Chipcon."; self.writecmd(0x30,0x10,0,self.data); @@ -106,6 +106,24 @@ class GoodFETCC(GoodFET): self.data=[adr&0xff, (adr&0xff00)>>8]; self.writecmd(0x30,0x91, 2, self.data); return ord(self.data[0]); + def CCpeekirambyte(self,adr): + """Read the contents of IRAM at an address.""" + self.data=[adr&0xff]; + self.writecmd(0x30,0x02, 1, self.data); + return ord(self.data[0]); + def CCpeekiramword(self,adr): + """Read the little-endian contents of IRAM at an address.""" + return self.CCpeekirambyte(adr)+( + self.CCpeekirambyte(adr+1)<<8); + def CCpokeiramword(self,adr,val): + self.CCpokeirambyte(adr,val&0xff); + self.CCpokeirambyte(adr+1,(val>>8)&0xff); + def CCpokeirambyte(self,adr,val): + """Write the contents of IRAM at an address.""" + self.data=[adr&0xff, val&0xff]; + self.writecmd(0x30,0x02, 2, self.data); + return ord(self.data[0]); + def CCpokedatabyte(self,adr,val): """Write a byte to data memory.""" self.data=[adr&0xff, (adr&0xff00)>>8, val]; @@ -145,7 +163,7 @@ class GoodFETCC(GoodFET): str="%s %s" %(self.CCstatusbits[i],str); i*=2; return str; - def CCstart(self): + def start(self): """Start debugging.""" self.writecmd(0x30,0x20,0,self.data); ident=self.CCidentstr(); @@ -155,7 +173,7 @@ class GoodFETCC(GoodFET): self.CChaltcpu(); #print "Status: %s." % self.CCstatusstr(); - def CCstop(self): + def stop(self): """Stop debugging.""" self.writecmd(0x30,0x21,0,self.data); def CCstep_instr(self):