diff options
Diffstat (limited to 'host/lib/usrp/usrp2/mboard_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/mboard_impl.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index 29e0535f8..520ee49a6 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -26,6 +26,7 @@ #include <uhd/usrp/mboard_props.hpp> #include <uhd/utils/byteswap.hpp> #include <uhd/utils/algorithm.hpp> +#include <uhd/types/sensors.hpp> #include <boost/bind.hpp> #include <iostream> @@ -362,11 +363,32 @@ void usrp2_mboard_impl::get(const wax::obj &key_, wax::obj &val){ case MBOARD_PROP_CLOCK_RATE: val = this->get_master_clock_freq(); return; + + case MBOARD_PROP_SENSOR: + if(key.name == "mimo_locked") { + val = sensor_value_t("MIMO", this->get_mimo_locked(), "locked", "unlocked"); + return; + } + else if(key.name == "ref_locked") { + val = sensor_value_t("Ref", this->get_ref_locked(), "locked", "unlocked"); + return; + } else { + UHD_THROW_PROP_GET_ERROR(); + } + break; default: UHD_THROW_PROP_GET_ERROR(); } } +bool usrp2_mboard_impl::get_mimo_locked(void) { + return bool((_iface->peek32(_iface->regs.irq_rb) & (1<<10)) > 0); +} + +bool usrp2_mboard_impl::get_ref_locked(void) { + return bool((_iface->peek32(_iface->regs.irq_rb) & (1<<11)) > 0); +} + /*********************************************************************** * MBoard Set Properties **********************************************************************/ |