Copy paste for RFX2200 in USRP1

This commit is contained in:
Jason Abele 2010-06-18 14:00:00 -07:00 committed by Johnathan Corgan
parent 0994dfe70c
commit b84513988d
3 changed files with 141 additions and 0 deletions

View 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:

View 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)
{

View 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