aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b200/b200_impl.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-01-14 15:25:10 +0100
committerMartin Braun <martin.braun@ettus.com>2015-01-14 15:25:10 +0100
commit39d3818a16ca2317ac64118acf5b59696a8723ca (patch)
tree99138c68294ea24bf74348d2173301d9ad4d8fbf /host/lib/usrp/b200/b200_impl.cpp
parent2f3f4b18cd18df85c5a5d381b1a331f6c0ebee82 (diff)
parentec11128445c00a8340b95dae6ed2d3ab5c7a5976 (diff)
downloaduhd-39d3818a16ca2317ac64118acf5b59696a8723ca.tar.gz
uhd-39d3818a16ca2317ac64118acf5b59696a8723ca.tar.bz2
uhd-39d3818a16ca2317ac64118acf5b59696a8723ca.zip
Merge branch 'maint'
Diffstat (limited to 'host/lib/usrp/b200/b200_impl.cpp')
-rw-r--r--host/lib/usrp/b200/b200_impl.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index 1523f1858..8ea50296f 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -684,7 +684,9 @@ void b200_impl::setup_radio(const size_t dspno)
const fs_path rf_fe_path = mb_path / "dboards" / "A" / (x+"_frontends") / (dspno? "B" : "A");
_tree->create<std::string>(rf_fe_path / "name").set("FE-"+key);
- _tree->create<int>(rf_fe_path / "sensors"); //empty TODO
+ _tree->create<int>(rf_fe_path / "sensors");
+ _tree->create<sensor_value_t>(rf_fe_path / "sensors" / "lo_locked")
+ .publish(boost::bind(&b200_impl::get_fe_pll_locked, this, x == "tx"));
BOOST_FOREACH(const std::string &name, ad9361_ctrl::get_gain_names(key))
{
_tree->create<meta_range_t>(rf_fe_path / "gains" / name / "range")
@@ -1059,3 +1061,10 @@ sensor_value_t b200_impl::get_ref_locked(void)
const bool lock = (_local_ctrl->peek32(RB32_CORE_MISC) & 0x1) == 0x1;
return sensor_value_t("Ref", lock, "locked", "unlocked");
}
+
+sensor_value_t b200_impl::get_fe_pll_locked(const bool is_tx)
+{
+ const boost::uint32_t st = _local_ctrl->peek32(RB32_CORE_PLL);
+ const bool locked = is_tx ? st & 0x1 : st & 0x2;
+ return sensor_value_t("LO", locked, "locked", "unlocked");
+}