Radio Structures in OOP

Dependencies:   mbed mbed-rtos

Revision:
6:4a3dbfbc30f1
Parent:
5:146523a0d1f4
--- a/drivers/CC1101/CC1101.h	Wed Jan 14 17:46:44 2015 +0000
+++ b/drivers/CC1101/CC1101.h	Thu Jan 15 07:15:33 2015 +0000
@@ -5,7 +5,6 @@
 #include "CommLink.h"
 #include "cmsis_os.h"
 #include "RTP.h"
-//#include "ThreadHelper.h"
 #include "CC1101-Defines.h"
 
 #define CCXXX1_DEBUG_MODE 0
@@ -21,19 +20,21 @@
     virtual ~CC1101();
 
     // These must have implementations in the CC1101 class since it is a derived class of the base class CommLink
-    virtual uint32_t reset(void);
-    virtual uint32_t selfTest(void);
+    virtual void reset(void);
+    virtual int32_t selfTest(void);
     virtual bool isConnected(void);
     
     // Set/Get the chip's operating channel
     void channel(uint16_t);
     uint16_t channel(void);
     
-    // Set/Get the chip's datarate (baudrate)
+    // Set/Get the chip's address if applicable
+    void address(uint8_t);
+    uint8_t address(void);
+    
+    // Get the chip's datarate (baudrate)
     uint16_t datarate(void);
     
-    void address(uint8_t);
-    
     // The NOP command used to get the CC1101's status byte
     uint8_t status(void);
     uint8_t status(uint8_t);
@@ -44,6 +45,7 @@
     int32_t powerUp(void);
     
 protected:
+    // These must have implementations in the CC1101 class since it is a derived class of the base class CommLink
     virtual int32_t sendData(uint8_t*, uint8_t);
     virtual int32_t getData(uint8_t*, uint8_t*);
     
@@ -53,23 +55,25 @@
     uint8_t read_reg(uint8_t);
     void read_reg(uint8_t, uint8_t*, uint8_t);
     
+    // Send a command strobe to the CC1101 (1 byte SPI transfer)
     uint8_t strobe(uint8_t);
     
+    // Send the TX or RX command strobe for placing the CC1101 in the respective state
     void tx_mode(void);
     void rx_mode(void);
+    void idle(void);
     
+    // Send the command strobe to flush the TX or RX buffers on the CC1101
     void flush_tx(void);
     void flush_rx(void);
     
-    void idle(void);
-    
     void freq(uint32_t);
     void datarate(uint32_t);    // set data rate
     void put_rf_settings(void);
     void init(void);
     
 private:
-    void setup(void);
+
 
     void calibrate(void);
     void tiny_delay(void);
@@ -78,7 +82,7 @@
     
     void assign_modem_params(void);
     void assign_packet_params(void);
-    void assign_if_freq(uint32_t);
+    void interface_freq(uint32_t);
     void assign_channel_spacing(uint32_t);
     void set_rf_settings(void);
     void set_init_vars(void);