diff options
author | Lane Kolbly <lane.kolbly@ni.com> | 2022-03-18 15:42:03 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-03-23 16:14:07 -0500 |
commit | 48b76f49bc7e5498df4fba9274063913d7f31cfb (patch) | |
tree | d17d2ea71a3f302ccf9016b961f9eca1909cd763 /host/lib/usrp/x400/x400_gpio_control.hpp | |
parent | 1ba8c2517d7162e0a5df1006abffcfc0ca910394 (diff) | |
download | uhd-48b76f49bc7e5498df4fba9274063913d7f31cfb.tar.gz uhd-48b76f49bc7e5498df4fba9274063913d7f31cfb.tar.bz2 uhd-48b76f49bc7e5498df4fba9274063913d7f31cfb.zip |
host: x410: Emulate GPIO classic ATR mode using new mode
This fixes an issue with setting the active channel source in MPM, and
additionally allows opening up the more flexible API in the future without
requiring a filesystem update.
Diffstat (limited to 'host/lib/usrp/x400/x400_gpio_control.hpp')
-rw-r--r-- | host/lib/usrp/x400/x400_gpio_control.hpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/host/lib/usrp/x400/x400_gpio_control.hpp b/host/lib/usrp/x400/x400_gpio_control.hpp index 492413685..fdaa671ec 100644 --- a/host/lib/usrp/x400/x400_gpio_control.hpp +++ b/host/lib/usrp/x400/x400_gpio_control.hpp @@ -6,6 +6,7 @@ #pragma once +#include <uhdlib/usrp/common/mpmd_mb_controller.hpp> #include <uhdlib/usrp/common/rpc.hpp> #include <uhdlib/usrp/cores/gpio_atr_3000.hpp> #include <uhdlib/usrp/cores/gpio_port_mapper.hpp> @@ -56,7 +57,7 @@ public: * \param rpcc RPC object to talk to MPM * \param iface wb_iface to talk to the radio registers */ - gpio_control(uhd::usrp::x400_rpc_iface::sptr rpcc, wb_iface::sptr iface); + gpio_control(uhd::usrp::x400_rpc_iface::sptr rpcc, uhd::rfnoc::mpmd_mb_controller::sptr mb_control, wb_iface::sptr iface); /*! Set the given GPIO attribute. See gpio_atr_3000 for details. */ @@ -77,11 +78,22 @@ private: */ uint32_t map_dio(const uint32_t user_form); + /*! Builds the mask of which pins are currently assigned to the DBx_RF1 + * source. Returns the pins in "unmapped" form. + */ + uint32_t build_rf1_mask(); + + /*! Returns the numeric index of the given ATR attribute in the array of + * ATR value registers. + */ + static size_t atr_attr_index(const uhd::usrp::gpio_atr::gpio_attr_t attr); + /*! Returns whether the given attribute is setting one of the ATR entries. */ static bool is_atr_attr(const usrp::gpio_atr::gpio_attr_t attr); uhd::usrp::x400_rpc_iface::sptr _rpcc; + uhd::rfnoc::mpmd_mb_controller::sptr _mb_control; wb_iface::sptr _regs; // There are two GPIOs, one for each channel. These two are set in unison. |