diff --git a/host/include/usrp/db_flexrf.h b/host/include/usrp/db_flexrf.h index 0c83440..70a5551 100644 --- a/host/include/usrp/db_flexrf.h +++ b/host/include/usrp/db_flexrf.h @@ -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: diff --git a/host/lib/db_flexrf.cc b/host/lib/db_flexrf.cc index 07ac2be..2819c19 100644 --- a/host/lib/db_flexrf.cc +++ b/host/lib/db_flexrf.cc @@ -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) { diff --git a/host/lib/usrp_dbid.dat b/host/lib/usrp_dbid.dat index 5193a5f..2548d73 100644 --- a/host/lib/usrp_dbid.dat +++ b/host/lib/usrp_dbid.dat @@ -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