summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-04-13 16:08:14 -0700
committerJosh Blum <josh@joshknows.com>2010-04-13 16:08:14 -0700
commit841400bb4e72375b439f04f0bd855e64b9f83f00 (patch)
treeb92e420c42539df522153f8d8f2b6a41b6ebd7af /host/lib/usrp
parent75dd8f674004d015425f194f8f4714b08f9ec018 (diff)
downloaduhd-841400bb4e72375b439f04f0bd855e64b9f83f00.tar.gz
uhd-841400bb4e72375b439f04f0bd855e64b9f83f00.tar.bz2
uhd-841400bb4e72375b439f04f0bd855e64b9f83f00.zip
Moved ad9777 control 100% on to the host
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index 4361e45cd..ea268651a 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -17,6 +17,7 @@
#include "usrp2_impl.hpp"
#include "usrp2_regs.hpp"
+#include "ad9777_regs.hpp"
#include <uhd/usrp/mboard_props.hpp>
#include <uhd/utils/assert.hpp>
#include <uhd/types/mac_addr.hpp>
@@ -35,6 +36,30 @@ void usrp2_impl::mboard_init(void){
);
_clock_control = clock_control::make_ad9510(this);
+
+ //setup the ad9777 dac
+ ad9777_regs_t ad9777_regs;
+ 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.pll_divide_ratio = ad9777_regs_t::PLL_DIVIDE_RATIO_DIV1;
+ ad9777_regs.pll_state = ad9777_regs_t::PLL_STATE_OFF;
+ ad9777_regs.auto_cp_control = ad9777_regs_t::AUTO_CP_CONTROL_ENB;
+ //I dac values
+ ad9777_regs.idac_fine_gain_adjust = 0;
+ ad9777_regs.idac_coarse_gain_adjust = 0xf;
+ ad9777_regs.idac_offset_adjust_lsb = 0;
+ ad9777_regs.idac_offset_adjust_msb = 0;
+ //Q dac values
+ ad9777_regs.qdac_fine_gain_adjust = 0;
+ ad9777_regs.qdac_coarse_gain_adjust = 0xf;
+ ad9777_regs.qdac_offset_adjust_lsb = 0;
+ ad9777_regs.qdac_offset_adjust_msb = 0;
+ //write all regs
+ for(boost::uint8_t addr = 0; addr <= 0xC; addr++){
+ boost::uint16_t data = ad9777_regs.get_write_reg(addr);
+ this->transact_spi(SPI_SS_AD9777, spi_config_t::EDGE_RISE, data, 16, false /*no rb*/);
+ }
}
clock_control::sptr usrp2_impl::get_clock_control(void){