aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-04-25 18:45:15 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:52 -0800
commitcf6619992ac0d9ed2d2c99ab17a98023ee162fef (patch)
tree13f2bee9499017fe3138297846093d32ae2f4152
parent151ba5fb06dfdb6fcc46ccfdabf5f1e064236981 (diff)
downloaduhd-cf6619992ac0d9ed2d2c99ab17a98023ee162fef.tar.gz
uhd-cf6619992ac0d9ed2d2c99ab17a98023ee162fef.tar.bz2
uhd-cf6619992ac0d9ed2d2c99ab17a98023ee162fef.zip
mpm: Added peek/poke interface to ad937x_ctrl
-rw-r--r--mpm/include/mpm/ad937x/ad937x_ctrl.hpp6
-rw-r--r--mpm/lib/mykonos/ad937x_ctrl.cpp12
2 files changed, 18 insertions, 0 deletions
diff --git a/mpm/include/mpm/ad937x/ad937x_ctrl.hpp b/mpm/include/mpm/ad937x/ad937x_ctrl.hpp
index 4d47a631f..ee3b5d6f3 100644
--- a/mpm/include/mpm/ad937x/ad937x_ctrl.hpp
+++ b/mpm/include/mpm/ad937x/ad937x_ctrl.hpp
@@ -167,6 +167,12 @@ public:
//! set step sizes for gain ctrl pins for one channel
virtual void set_gain_pin_step_sizes(const std::string &which, double inc_step, double dec_step) = 0;
+
+ //! Direct register read access
+ virtual uint8_t peek8(const uint32_t addr) = 0;
+
+ //! Direct register write access
+ virtual void poke8(const uint32_t addr, const uint8_t val) = 0;
};
}}; /* namespace mpm::chips */
diff --git a/mpm/lib/mykonos/ad937x_ctrl.cpp b/mpm/lib/mykonos/ad937x_ctrl.cpp
index 69ffeb6c2..6bd8b5ce1 100644
--- a/mpm/lib/mykonos/ad937x_ctrl.cpp
+++ b/mpm/lib/mykonos/ad937x_ctrl.cpp
@@ -381,6 +381,18 @@ public:
device.set_gain_pin_step_sizes(dir, chain, inc_step, dec_step);
}
+ uint8_t peek8(const uint32_t addr)
+ {
+ std::lock_guard<std::mutex> lock(*spi_mutex);
+ return _iface->peek8(addr);
+ }
+
+ void poke8(const uint32_t addr, const uint8_t val)
+ {
+ std::lock_guard<std::mutex> lock(*spi_mutex);
+ _iface->poke8(addr, val);
+ }
+
private:
ad937x_device device;
std::shared_ptr<std::mutex> spi_mutex;