diff options
author | Josh Blum <josh@joshknows.com> | 2011-04-29 11:02:08 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-04-29 11:02:08 -0700 |
commit | 6bd7281f83d5311675847b31746525841657c057 (patch) | |
tree | 14ac0cdec8e04089205c468544e0878001c354aa /host/lib/usrp/usrp2/mboard_impl.cpp | |
parent | 4d73aae4638e5c08b2f55ea229414319befec68e (diff) | |
download | uhd-6bd7281f83d5311675847b31746525841657c057.tar.gz uhd-6bd7281f83d5311675847b31746525841657c057.tar.bz2 uhd-6bd7281f83d5311675847b31746525841657c057.zip |
usrp2: added support for GPSDO configuration bits in EEPROM
Added instructions to install and burn eeprom to documentation.
Made gps_ctrl and gps_time sensor optional.
Added sensors for motherboard to documentation
Diffstat (limited to 'host/lib/usrp/usrp2/mboard_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/mboard_impl.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index 62cc3c403..ae098dba6 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -27,6 +27,7 @@ #include <uhd/utils/byteswap.hpp> #include <uhd/utils/algorithm.hpp> #include <uhd/types/sensors.hpp> +#include <boost/assign/list_of.hpp> #include <boost/bind.hpp> #include <iostream> @@ -101,9 +102,11 @@ usrp2_mboard_impl::usrp2_mboard_impl( //contruct the interfaces to mboard perifs _clock_ctrl = usrp2_clock_ctrl::make(_iface); _codec_ctrl = usrp2_codec_ctrl::make(_iface); - _gps_ctrl = gps_ctrl::make( - _iface->get_gps_write_fn(), - _iface->get_gps_read_fn()); + if (_iface->mb_eeprom["gpsdo"] == "internal"){ + _gps_ctrl = gps_ctrl::make( + _iface->get_gps_write_fn(), + _iface->get_gps_read_fn()); + } //init the dsp stuff (before setting update packets) dsp_init(); @@ -361,7 +364,14 @@ 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 SUBDEV_PROP_SENSOR_NAMES:{ + prop_names_t names = boost::assign::list_of("mimo_locked")("ref_locked"); + if (_gps_ctrl.get()) names.push_back("gps_time"); + val = names; + } + return; + case MBOARD_PROP_SENSOR: if(key.name == "mimo_locked") { val = sensor_value_t("MIMO", this->get_mimo_locked(), "locked", "unlocked"); @@ -371,7 +381,7 @@ void usrp2_mboard_impl::get(const wax::obj &key_, wax::obj &val){ val = sensor_value_t("Ref", this->get_ref_locked(), "locked", "unlocked"); return; } - else if(key.name == "gps_time") { + else if(key.name == "gps_time" and _gps_ctrl.get()) { val = sensor_value_t("GPS time", int(_gps_ctrl->get_epoch_time()), "seconds"); } else { |