diff options
-rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 11 | ||||
-rw-r--r-- | host/lib/usrp/b200/b200_impl.hpp | 1 | ||||
-rw-r--r-- | host/lib/usrp/b200/b200_regs.hpp | 1 |
3 files changed, 12 insertions, 1 deletions
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<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") @@ -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"); +} diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp index 8f03d81ad..ab95ebce1 100644 --- a/host/lib/usrp/b200/b200_impl.hpp +++ b/host/lib/usrp/b200/b200_impl.hpp @@ -143,6 +143,7 @@ private: void update_bandsel(const std::string& which, double freq); void update_antenna_sel(const size_t which, const std::string &ant); uhd::sensor_value_t get_ref_locked(void); + uhd::sensor_value_t get_fe_pll_locked(const bool is_tx); //perifs in the radio core struct radio_perifs_t diff --git a/host/lib/usrp/b200/b200_regs.hpp b/host/lib/usrp/b200/b200_regs.hpp index dc8a6b0dc..900651f94 100644 --- a/host/lib/usrp/b200/b200_regs.hpp +++ b/host/lib/usrp/b200/b200_regs.hpp @@ -32,6 +32,7 @@ localparam SR_CORE_PPS_SEL = 48; localparam RB32_CORE_SPI = 8; localparam RB32_CORE_MISC = 16; localparam RB32_CORE_STATUS = 20; +localparam RB32_CORE_PLL = 24; localparam SR_SPI = 8; localparam SR_ATR = 12; |