hz=freq*396.728515625;
return hz;
+
+ def RF_getchannel(self):
+ """Get the frequency in Hz."""
+ #FIXME CC1110 specific
+ freq=0;
+ try:
+ freq2=self.peekbysym("FREQ2");
+ freq1=self.peekbysym("FREQ1");
+ freq0=self.peekbysym("FREQ0");
+ freq=(freq2<<16)+(freq1<<8)+freq0;
+ except:
+ freq=0;
+
+ return freq;
+
+
lastshellcode="none";
- def shellcodefile(self,filename,wait=1):
+ def shellcodefile(self,filename,wait=1, alwaysreload=0):
"""Run a fragment of shellcode by name."""
#FIXME: should identify chip model number, use shellcode for that chip.
- if self.lastshellcode!=filename:
+ if self.lastshellcode!=filename or alwaysreload>0:
self.lastshellcode=filename;
file=__file__;
file=file.replace("GoodFETCC.pyc","GoodFETCC.py");
self.pokebysym("ADDR" , 0x01) # Device address.
self.pokebysym("PKTLEN" , 0xFF) # Packet length.
- self.pokebysym("SYNC1",0xD3);
- self.pokebysym("SYNC0",0x91);
+ #Sync word hack
+ self.pokebysym("SYNC1",0x83);
+ self.pokebysym("SYNC0",0xFE);
return;
def config_iclicker(self,band="lf"):
#Mike Ossmann figured most of this out, with help from neighbors.
0x8900:"cc2431",
0x8100:"cc2510",
0x9100:"cc2511",
- 0xA500:"cc2530", #page 52 of SWRU191
+ 0xA500:"cc2530", #page 57 of SWRU191B
0xB500:"cc2531",
+ 0x9500:"CC2533",
+ 0x8D00:"CC2540",
0xFF00:"CCmissing"};
CCpagesizes={0x01: 1024, #"CC1110",
0x11: 1024, #"CC1111",
0x89: 2048, #"CC2431",
0x81: 1024, #"CC2510",
0x91: 1024, #"CC2511",
- 0xA5: 2048, #"CC2530", #page 52 of SWRU191
+ 0xA5: 2048, #"CC2530", #page 57 of SWRU191B
0xB5: 2048, #"CC2531",
+ 0x95: 2048, #"CC2533",
+ 0x8D: 2048, #"CC2540",
0xFF: 0 } #"CCmissing"};
def infostring(self):
return self.CCidentstr();