aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp
diff options
context:
space:
mode:
authormattprost <matt.prost@ni.com>2022-04-06 13:51:35 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2022-04-07 13:28:02 -0700
commiteacbf15e30313793841ca6e4abd9cad02fffa5b4 (patch)
tree43e11ddcad3ef23c40b33f79d67afe54c92d270a /host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp
parent14a4b969b6757f3d4f24cfb69122ca2fd630e59a (diff)
downloaduhd-eacbf15e30313793841ca6e4abd9cad02fffa5b4.tar.gz
uhd-eacbf15e30313793841ca6e4abd9cad02fffa5b4.tar.bz2
uhd-eacbf15e30313793841ca6e4abd9cad02fffa5b4.zip
n310: cpld: Get and set TX ATR bits
This allows the user to get the current state of the tx atr bits and set them back to a given state. This is useful for the n310 when resetting the front end, in order to avoid any tx power out of the frontend when the init_cals are run. Signed-off-by: mattprost <matt.prost@ni.com>
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp')
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp b/host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp
index 27341673c..39c3f74c2 100644
--- a/host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp
+++ b/host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp
@@ -15,6 +15,17 @@
#include <memory>
#include <mutex>
+//! Structs for interfacing with the cpld register state
+// TODO: add structs and supporting function calls for other parts of the
+// magnesium cpld reg interface
+struct tx_atr_bits_t
+{
+ bool tx_led = false;
+ bool tx_pa_en = false;
+ bool tx_amp_en = false;
+ bool tx_myk_en = false;
+};
+
//! Controls the CPLD on a Magnesium daughterboard
//
// Setters are thread-safe through lock guards. This lets a CPLD control object
@@ -215,6 +226,13 @@ public:
const bool tx_myk_enb,
const bool defer_commit = false);
+ void set_tx_atr_bits(const chan_sel_t chan,
+ const atr_state_t atr_state,
+ const tx_atr_bits_t atr_bits,
+ const bool defer_commit = false);
+
+ tx_atr_bits_t get_tx_atr_bits(const chan_sel_t chan, const atr_state_t atr_state);
+
/*! ATR settings: TRX switch
*
* Note: This ATR state is frequency dependent.