Copy paste for RFX2200 in USRP1
authorJason Abele <jason@ettus.com>
Fri, 18 Jun 2010 21:00:00 +0000 (14:00 -0700)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Tue, 22 Jun 2010 00:04:47 +0000 (17:04 -0700)
usrp/host/include/usrp/db_flexrf.h
usrp/host/lib/db_flexrf.cc
usrp/host/lib/usrp_dbid.dat

index 0c834402d0e44f8fa4f70bec409bc85672fef007..70a55514ee5188fa4c0938567577cb229b796805 100644 (file)
@@ -138,6 +138,18 @@ protected:
 
 //----------------------------------------------------------------------
 
+class _2200_common : public _AD4360_common
+{
+ public:
+  _2200_common();
+  ~_2200_common() {}
+  double freq_min();
+  double freq_max();
+};
+
+//----------------------------------------------------------------------
+
 class _2400_common : public _AD4360_common
 {
  public:
@@ -212,6 +224,34 @@ public:
 
 //------------------------------------------------------------    
 
+class db_flexrf_2200_tx : public flexrf_base_tx
+{
+ public:
+  db_flexrf_2200_tx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_2200_tx();
+
+  // Wrapper calls to d_common functions
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+class db_flexrf_2200_rx : public flexrf_base_rx
+{
+public:
+  db_flexrf_2200_rx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_2200_rx();
+  
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool i_and_q_swapped();
+
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+//------------------------------------------------------------    
+
 class db_flexrf_2400_tx : public flexrf_base_tx
 {
  public:
index 07ac2be3bc22e1cafc1479e5dee61e2d31b9c245..2819c19bd79f73c443a3c0c13fd690e3b76f5947 100644 (file)
@@ -639,6 +639,38 @@ _AD4360_common::_prescaler()
 
 //----------------------------------------------------------------------
 
+_2200_common::_2200_common()
+  : _AD4360_common()
+{
+  // Band-specific R-Register Values
+  d_R_DIV = 16;  // bits 15:2
+   
+  // Band-specific C-Register values
+  d_P = 1;        // bits 23,22   Div by 16/17
+  d_CP2 = 7;      // bits 19:17
+  d_CP1 = 7;      // bits 16:14
+
+  // Band specifc N-Register Values
+  d_DIVSEL = 0;   // bit 23
+  d_DIV2 = 0;     // bit 22
+  d_CPGAIN = 0;   // bit 21
+  d_freq_mult = 1;
+}
+
+double
+_2200_common::freq_min()
+{
+  return 2000e6;
+}
+
+double
+_2200_common::freq_max()
+{
+  return 2400e6;
+}
+
+//----------------------------------------------------------------------
+
 _2400_common::_2400_common()
   : _AD4360_common()
 {
@@ -811,6 +843,72 @@ _400_rx::_400_rx()
 
 //------------------------------------------------------------    
 
+db_flexrf_2200_tx::db_flexrf_2200_tx(usrp_basic_sptr usrp, int which)
+  : flexrf_base_tx(usrp, which)
+{
+  d_common = new _2200_common();
+}
+
+db_flexrf_2200_tx::~db_flexrf_2200_tx()
+{
+}
+
+bool
+db_flexrf_2200_tx::_compute_regs(double freq, int &retR, int &retcontrol,
+                                int &retN, double &retfreq)
+{
+  return d_common->_compute_regs(_refclk_freq(), freq, retR,
+                                retcontrol, retN, retfreq);
+}
+
+
+
+db_flexrf_2200_rx::db_flexrf_2200_rx(usrp_basic_sptr usrp, int which)
+  : flexrf_base_rx(usrp, which)
+{
+  d_common = new _2200_common();
+  set_gain((gain_min() + gain_max()) / 2.0);  // initialize gain
+}
+
+db_flexrf_2200_rx::~db_flexrf_2200_rx()
+{
+}
+
+float
+db_flexrf_2200_rx::gain_min()
+{
+  return usrp()->pga_min();
+}
+
+float
+db_flexrf_2200_rx::gain_max()
+{
+  return usrp()->pga_max()+70;
+}
+
+float
+db_flexrf_2200_rx::gain_db_per_step()
+{
+  return 0.05;
+}
+
+
+bool
+db_flexrf_2200_rx::i_and_q_swapped()
+{
+  return true;
+}
+
+bool
+db_flexrf_2200_rx::_compute_regs(double freq, int &retR, int &retcontrol,
+                                int &retN, double &retfreq)
+{
+  return d_common->_compute_regs(_refclk_freq(), freq, retR,
+                                retcontrol, retN, retfreq);
+}
+
+//------------------------------------------------------------    
+
 db_flexrf_2400_tx::db_flexrf_2400_tx(usrp_basic_sptr usrp, int which)
   : flexrf_base_tx(usrp, which)
 {
index 5193a5fa0ef18b66f13985864d229205471c3681..2548d737e5cf0d6c1485d362c62bedac3b9ba421 100644 (file)
@@ -61,6 +61,9 @@
 "Flex 1200 Tx MIMO B"  0x002a
 "Flex 2400 Tx MIMO B"  0x002b
 
+"Flex 2200 Rx MIMO B"  0x002c
+"Flex 2200 Tx MIMO B"  0x002d
+
 "Flex 1800 Rx"         0x0030
 "Flex 1800 Tx"         0x0031
 "Flex 1800 Rx MIMO A"  0x0032