Added CC1110 radio strobes. Will be useful for generalizing things later.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 9 Dec 2010 19:00:14 +0000 (19:00 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 9 Dec 2010 19:00:14 +0000 (19:00 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@778 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFETCC.py
client/goodfet.cc

index b14b713..3fe5870 100644 (file)
@@ -145,9 +145,32 @@ class GoodFETCC(GoodFET):
         self.shellcode(code);
         return;
     def RF_idle(self):
-        RFST=0xDFE1
-        self.pokebyte(RFST,0x04); #Return to idle state.
+        """Move the radio to its idle state."""
+        self.CC_RFST_IDLE();
+        return;
     
+    #Chipcon RF strobes.  CC1110 specific
+    RFST_IDLE=0x04;
+    RFST_RX=0x02;
+    RFST_TX=0x03;
+    RFST_CAL=0x01;
+    def CC_RFST_IDLE(self):
+        """Switch the radio to idle mode, clearing overflows and errors."""
+        self.CC_RFST(self.RFST_IDLE);
+    def CC_RFST_TX(self):
+        """Switch the radio to TX mode."""
+        self.CC_RFST(self.RFST_TX);
+    def CC_RFST_RX(self):
+        """Switch the radio to RX mode."""
+        self.CC_RFST(self.RFST_RX);
+    def CC_RFST_CAL(self):
+        """Calibrate strobe the radio."""
+        self.CC_RFST(self.RFST_CAL);
+    def CC_RFST(self,state=RFST_IDLE):
+        RFST=0xDFE1
+        self.pokebyte(RFST,state); #Return to idle state.
+        return;
+        
     def config_simpliciti(self,band="none"):
         self.pokebysym("FSCTRL1"  , 0x08)   # Frequency synthesizer control.
         self.pokebysym("FSCTRL0"  , 0x00)   # Frequency synthesizer control.
index 10ed3cf..14709b3 100755 (executable)
@@ -119,7 +119,6 @@ if(sys.argv[1]=="reflex"):
             print "JAMMING JAMMING JAMMING JAMMING";
 
 if(sys.argv[1]=="sniffsimpliciti"):
-    #Reversal of transmitter code from nRF_CMD.c of OpenBeacon
     #TODO remove all poke() calls.
     
     client.CC1110_crystal();