aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/mboard_impl.cpp
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2011-04-05 09:18:14 -0700
committerJosh Blum <josh@joshknows.com>2011-04-29 09:58:54 -0700
commit4df082cb4eb6659d76dd9a38988033c82c662fa9 (patch)
tree59f17b824f0e139d255bf7e3ea32b0f817b5f55d /host/lib/usrp/usrp2/mboard_impl.cpp
parent36314331a373d902909d6616064b9c72e71efabb (diff)
downloaduhd-4df082cb4eb6659d76dd9a38988033c82c662fa9.tar.gz
uhd-4df082cb4eb6659d76dd9a38988033c82c662fa9.tar.bz2
uhd-4df082cb4eb6659d76dd9a38988033c82c662fa9.zip
N210: implemented mboard sensors for ref lock and MIMO lock
Diffstat (limited to 'host/lib/usrp/usrp2/mboard_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp22
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
**********************************************************************/