aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300/x300_adc_ctrl.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2014-09-25 17:29:43 -0700
committerMartin Braun <martin.braun@ettus.com>2014-09-25 17:29:43 -0700
commit994e993893d921c074ce4097632f8fa5bdecff66 (patch)
treec1e0fe3601e0ce8d7fa3690f578d0f341e610fed /host/lib/usrp/x300/x300_adc_ctrl.cpp
parenta1767ede3c147c1748c6a33a52469d0cba644bf5 (diff)
parent9dc96fd9bf8d430a9f41f3476bc62cc3ba43e1d7 (diff)
downloaduhd-994e993893d921c074ce4097632f8fa5bdecff66.tar.gz
uhd-994e993893d921c074ce4097632f8fa5bdecff66.tar.bz2
uhd-994e993893d921c074ce4097632f8fa5bdecff66.zip
Merge branch 'maint'
Diffstat (limited to 'host/lib/usrp/x300/x300_adc_ctrl.cpp')
-rw-r--r--host/lib/usrp/x300/x300_adc_ctrl.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/host/lib/usrp/x300/x300_adc_ctrl.cpp b/host/lib/usrp/x300/x300_adc_ctrl.cpp
index 53d1662ae..b0e4e4b95 100644
--- a/host/lib/usrp/x300/x300_adc_ctrl.cpp
+++ b/host/lib/usrp/x300/x300_adc_ctrl.cpp
@@ -38,6 +38,11 @@ public:
x300_adc_ctrl_impl(uhd::spi_iface::sptr iface, const size_t slaveno):
_iface(iface), _slaveno(slaveno)
{
+ init();
+ }
+
+ void init()
+ {
//power-up adc
_ads62p48_regs.reset = 1;
this->send_ads62p48_reg(0x00); //issue a reset to the ADC
@@ -50,8 +55,8 @@ public:
_ads62p48_regs.lvds_cmos = ads62p48_regs_t::LVDS_CMOS_DDR_LVDS;
_ads62p48_regs.channel_control = ads62p48_regs_t::CHANNEL_CONTROL_INDEPENDENT;
_ads62p48_regs.data_format = ads62p48_regs_t::DATA_FORMAT_2S_COMPLIMENT;
- _ads62p48_regs.clk_out_pos_edge = ads62p48_regs_t::CLK_OUT_POS_EDGE_MINUS7_26;
- _ads62p48_regs.clk_out_neg_edge = ads62p48_regs_t::CLK_OUT_NEG_EDGE_MINUS7_26;
+ _ads62p48_regs.clk_out_pos_edge = ads62p48_regs_t::CLK_OUT_POS_EDGE_MINUS7_26;
+ _ads62p48_regs.clk_out_neg_edge = ads62p48_regs_t::CLK_OUT_NEG_EDGE_MINUS7_26;
this->send_ads62p48_reg(0);
@@ -76,6 +81,11 @@ public:
}
+ void reset()
+ {
+ init();
+ }
+
double set_gain(const double &gain)
{
const meta_range_t gain_range = meta_range_t(0, 6.0, 0.5);