From eacbf15e30313793841ca6e4abd9cad02fffa5b4 Mon Sep 17 00:00:00 2001 From: mattprost Date: Wed, 6 Apr 2022 13:51:35 -0500 Subject: 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 --- host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp') 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 #include +//! 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. -- cgit v1.2.3