From ec11128445c00a8340b95dae6ed2d3ab5c7a5976 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 14 Jan 2015 15:15:19 +0100 Subject: b200: Added lo_locked sensor --- host/lib/usrp/b200/b200_impl.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/b200/b200_impl.cpp') diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index aa309e7eb..13bdc09b4 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -630,7 +630,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(rf_fe_path / "name").set("FE-"+key); - _tree->create(rf_fe_path / "sensors"); //empty TODO + _tree->create(rf_fe_path / "sensors"); + _tree->create(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(rf_fe_path / "gains" / name / "range") @@ -1000,3 +1002,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"); +} -- cgit v1.2.3