diff options
author | Josh Blum <josh@joshknows.com> | 2010-12-14 14:54:26 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-12-14 14:54:26 -0800 |
commit | 1c06810258ae657ce373da2333f8fa98afb1981d (patch) | |
tree | 7473b292e8ea19b0a7294d3832503357502b5f25 /host/lib/usrp/usrp2/codec_ctrl.cpp | |
parent | 3ed60b62eaf2d907ec7797f61ca60420bfd2ee5b (diff) | |
parent | f3bf32df9f747aa47f8463516e817c305e731231 (diff) | |
download | uhd-1c06810258ae657ce373da2333f8fa98afb1981d.tar.gz uhd-1c06810258ae657ce373da2333f8fa98afb1981d.tar.bz2 uhd-1c06810258ae657ce373da2333f8fa98afb1981d.zip |
Merge branch 'dsp_tune'
Diffstat (limited to 'host/lib/usrp/usrp2/codec_ctrl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/codec_ctrl.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/host/lib/usrp/usrp2/codec_ctrl.cpp b/host/lib/usrp/usrp2/codec_ctrl.cpp index ad1ae1acb..4f2cd88bb 100644 --- a/host/lib/usrp/usrp2/codec_ctrl.cpp +++ b/host/lib/usrp/usrp2/codec_ctrl.cpp @@ -39,7 +39,7 @@ public: //setup the ad9777 dac _ad9777_regs.x_1r_2r_mode = ad9777_regs_t::X_1R_2R_MODE_1R; _ad9777_regs.filter_interp_rate = ad9777_regs_t::FILTER_INTERP_RATE_4X; - _ad9777_regs.mix_mode = ad9777_regs_t::MIX_MODE_REAL; + _ad9777_regs.mix_mode = ad9777_regs_t::MIX_MODE_COMPLEX; _ad9777_regs.pll_divide_ratio = ad9777_regs_t::PLL_DIVIDE_RATIO_DIV1; _ad9777_regs.pll_state = ad9777_regs_t::PLL_STATE_ON; _ad9777_regs.auto_cp_control = ad9777_regs_t::AUTO_CP_CONTROL_AUTO; @@ -57,6 +57,7 @@ public: for(boost::uint8_t addr = 0; addr <= 0xC; addr++){ this->send_ad9777_reg(addr); } + set_tx_mod_mode(0); //power-up adc switch(_iface->get_rev()){ @@ -102,6 +103,26 @@ public: } } + void set_tx_mod_mode(int mod_mode){ + //set the sign of the frequency shift + _ad9777_regs.modulation_form = (mod_mode > 0)? + ad9777_regs_t::MODULATION_FORM_E_PLUS_JWT: + ad9777_regs_t::MODULATION_FORM_E_MINUS_JWT + ; + + //set the frequency shift + switch(std::abs(mod_mode)){ + case 0: + case 1: _ad9777_regs.modulation_mode = ad9777_regs_t::MODULATION_MODE_NONE; break; + case 2: _ad9777_regs.modulation_mode = ad9777_regs_t::MODULATION_MODE_FS_2; break; + case 4: _ad9777_regs.modulation_mode = ad9777_regs_t::MODULATION_MODE_FS_4; break; + case 8: _ad9777_regs.modulation_mode = ad9777_regs_t::MODULATION_MODE_FS_8; break; + default: throw std::runtime_error("unknown modulation mode for ad9777"); + } + + this->send_ad9777_reg(0x01); //set the register + } + void set_rx_digital_gain(float gain) { //fine digital gain switch(_iface->get_rev()){ case usrp2_iface::USRP_N200: |