From 6bd7281f83d5311675847b31746525841657c057 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 29 Apr 2011 11:02:08 -0700 Subject: 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 --- host/lib/usrp/usrp2/mboard_impl.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'host/lib/usrp/usrp2') 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 #include #include +#include #include #include @@ -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 { -- cgit v1.2.3