aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-11-16 16:41:32 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:07 -0800
commitb14cafd90c84e69cdb77aec2d8553c4d45213b8f (patch)
tree31207b8e54653391c9ebe2663ac4136691089507 /host
parent688247e5451216e82c3817e75d0c2bcfb70488c9 (diff)
downloaduhd-b14cafd90c84e69cdb77aec2d8553c4d45213b8f.tar.gz
uhd-b14cafd90c84e69cdb77aec2d8553c4d45213b8f.tar.bz2
uhd-b14cafd90c84e69cdb77aec2d8553c4d45213b8f.zip
mpm: mg: Add dboard sensors for low- and highband LO lock status
- Add LO locked APIs to Magnesium - Add LO locked sensor APIs for RX/TX and highband/lowband LOs - Poll all those sensors from magnesium_radio_ctrl_impl Reviewed-By: Steven Bingler <steven.bingler@ni.com> Reviewed-By: Trung Tran <trung.tran@ettus.com>
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp
index 52bce2e9a..290c5f541 100644
--- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp
+++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp
@@ -430,9 +430,33 @@ void magnesium_radio_ctrl_impl::set_rpc_client(
}
bool magnesium_radio_ctrl_impl::get_lo_lock_status(
- const direction_t /*dir*/
+ const direction_t dir
) {
- return bool(_rpcc); // FIXME
+ if (not (bool(_rpcc))) {
+ UHD_LOG_DEBUG(unique_id(),
+ "Reported no LO lock due to lack of RPC connection.");
+ return false;
+ }
+
+ const std::string trx = (dir == RX_DIRECTION) ? "rx" : "tx";
+ const size_t chan = 0; // They're the same after all
+ const double freq = (dir == RX_DIRECTION) ?
+ get_rx_frequency(chan) :
+ get_tx_frequency(chan);
+
+ bool lo_lock = _rpcc->request_with_token<bool>(
+ _rpc_prefix + "get_ad9371_lo_lock", trx);
+ UHD_LOG_TRACE(unique_id(),
+ "AD9371 " << trx << " LO reports lock: " << (lo_lock ? "Yes" : "No"));
+ if (lo_lock && freq < MAGNESIUM_LOWBAND_FREQ) {
+ lo_lock = lo_lock && _rpcc->request_with_token<bool>(
+ _rpc_prefix + "get_lowband_lo_lock", trx);
+ UHD_LOG_TRACE(unique_id(),
+ "ADF4351 " << trx << " LO reports lock: "
+ << (lo_lock ? "Yes" : "No"));
+ }
+
+ return lo_lock;
}
UHD_RFNOC_BLOCK_REGISTER(magnesium_radio_ctrl, "MagnesiumRadio");