diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/include/uhd/usrp/subdev_props.hpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_basic_and_lf.cpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_rfx.cpp | 17 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_xcvr2450.cpp | 16 |
4 files changed, 45 insertions, 4 deletions
diff --git a/host/include/uhd/usrp/subdev_props.hpp b/host/include/uhd/usrp/subdev_props.hpp index cd6b14ef5..1f8e91d68 100644 --- a/host/include/uhd/usrp/subdev_props.hpp +++ b/host/include/uhd/usrp/subdev_props.hpp @@ -35,13 +35,13 @@ namespace uhd{ namespace usrp{ SUBDEV_PROP_FREQ_RANGE = 'F', //ro, freq_range_t SUBDEV_PROP_ANTENNA = 'a', //rw, std::string SUBDEV_PROP_ANTENNA_NAMES = 'A', //ro, prop_names_t - //SUBDEV_PROP_ENABLED = 'e', //rw, bool //---> dont need, we have atr + SUBDEV_PROP_LO_LOCKED = 'L', //ro, bool SUBDEV_PROP_QUADRATURE = 'q', //ro, bool SUBDEV_PROP_IQ_SWAPPED = 'i', //ro, bool SUBDEV_PROP_SPECTRUM_INVERTED = 's', //ro, bool - SUBDEV_PROP_USE_LO_OFFSET = 'l' //ro, bool - //SUBDEV_PROP_RSSI, //ro, float //----> not on all boards, use named prop - //SUBDEV_PROP_BANDWIDTH //rw, double //----> not on all boards, use named prop + SUBDEV_PROP_USE_LO_OFFSET = 'l', //ro, bool + SUBDEV_PROP_RSSI = 'R', //ro, float + SUBDEV_PROP_BANDWIDTH = 'B' //rw, double }; }} //namespace diff --git a/host/lib/usrp/dboard/db_basic_and_lf.cpp b/host/lib/usrp/dboard/db_basic_and_lf.cpp index 4ca2ef9b1..fa53bd964 100644 --- a/host/lib/usrp/dboard/db_basic_and_lf.cpp +++ b/host/lib/usrp/dboard/db_basic_and_lf.cpp @@ -154,6 +154,10 @@ void basic_rx::rx_get(const wax::obj &key_, wax::obj &val){ val = false; return; + case SUBDEV_PROP_LO_LOCKED: + val = true; //there is no LO, so it must be true! + return; + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -249,6 +253,10 @@ void basic_tx::tx_get(const wax::obj &key_, wax::obj &val){ val = false; return; + case SUBDEV_PROP_LO_LOCKED: + val = true; //there is no LO, so it must be true! + return; + default: UHD_THROW_PROP_WRITE_ONLY(); } } diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp index 14879dbed..6ad5ad906 100644 --- a/host/lib/usrp/dboard/db_rfx.cpp +++ b/host/lib/usrp/dboard/db_rfx.cpp @@ -94,6 +94,15 @@ private: * \return the actual frequency in Hz */ double set_lo_freq(dboard_iface::unit_t unit, double target_freq); + + /*! + * Get the lock detect status of the LO. + * \param unit which unit rx or tx + * \return true for locked + */ + bool get_locked(dboard_iface::unit_t unit){ + return (this->get_iface()->read_gpio(unit) & LOCKDET_MASK) != 0; + } }; /*********************************************************************** @@ -397,6 +406,10 @@ void rfx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){ val = false; return; + case SUBDEV_PROP_LO_LOCKED: + val = this->get_locked(dboard_iface::UNIT_RX); + return; + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -486,6 +499,10 @@ void rfx_xcvr::tx_get(const wax::obj &key_, wax::obj &val){ val = true; return; + case SUBDEV_PROP_LO_LOCKED: + val = this->get_locked(dboard_iface::UNIT_TX); + return; + default: UHD_THROW_PROP_WRITE_ONLY(); } } diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 576d08848..5b932904d 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -126,6 +126,14 @@ private: } static bool is_highband(double freq){return freq > 3e9;} + + /*! + * Is the LO locked? + * \return true for locked + */ + bool get_locked(void){ + return (this->get_iface()->read_gpio(dboard_iface::UNIT_RX) & LOCKDET_RXIO) != 0; + } }; /*********************************************************************** @@ -476,6 +484,10 @@ void xcvr2450::rx_get(const wax::obj &key_, wax::obj &val){ val = false; return; + case SUBDEV_PROP_LO_LOCKED: + val = this->get_locked(); + return; + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -566,6 +578,10 @@ void xcvr2450::tx_get(const wax::obj &key_, wax::obj &val){ val = false; return; + case SUBDEV_PROP_LO_LOCKED: + val = this->get_locked(); + return; + default: UHD_THROW_PROP_WRITE_ONLY(); } } |