aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/include
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-04-29 18:57:30 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:52 -0800
commit0e7fe25f42105de0d01fc568cc717f9f04d825b7 (patch)
tree452f459405a70a07e1f157fcc20fffebc1947c00 /mpm/include
parentfcf8715eab6d3d06526e1ef1398e0e684711daad (diff)
downloaduhd-0e7fe25f42105de0d01fc568cc717f9f04d825b7.tar.gz
uhd-0e7fe25f42105de0d01fc568cc717f9f04d825b7.tar.bz2
uhd-0e7fe25f42105de0d01fc568cc717f9f04d825b7.zip
mpm: eiscat: Added first pass at EISCAT dboard driver
Diffstat (limited to 'mpm/include')
-rw-r--r--mpm/include/mpm/dboards/eiscat_manager.hpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/mpm/include/mpm/dboards/eiscat_manager.hpp b/mpm/include/mpm/dboards/eiscat_manager.hpp
new file mode 100644
index 000000000..42f80ff8e
--- /dev/null
+++ b/mpm/include/mpm/dboards/eiscat_manager.hpp
@@ -0,0 +1,70 @@
+//
+// Copyright 2017 Ettus Research (National Instruments)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#pragma once
+
+#include <mpm/types/lockable.hpp>
+#include <mpm/types/regs_iface.hpp>
+#include <memory>
+#include <mutex>
+
+namespace mpm { namespace dboards {
+ class eiscat_manager// : public dboard_periph_manager
+ {
+ public:
+ eiscat_manager(
+ const std::string &lmk_spidev,
+ const std::string &adc0_spidev,
+ const std::string &adc1_spidev
+ //const std::string &phdac_spidev,
+ );
+
+ /*! Return a reference to the SPI mutex
+ */
+ mpm::types::lockable::sptr get_spi_lock() { return _spi_lock; }
+
+ /*! Return a reference to the clock chip controls
+ */
+ mpm::types::regs_iface::sptr get_clock_ctrl(){ return _clock_ctrl; }
+
+ mpm::types::regs_iface::sptr get_adc0_ctrl(){ return _adc0_ctrl; }
+ mpm::types::regs_iface::sptr get_adc1_ctrl(){ return _adc1_ctrl; }
+
+ private:
+ std::shared_ptr<std::mutex> _spi_mutex;
+
+ mpm::types::lockable::sptr _spi_lock;
+ mpm::types::regs_iface::sptr _clock_ctrl;
+ mpm::types::regs_iface::sptr _adc0_ctrl;
+ mpm::types::regs_iface::sptr _adc1_ctrl;
+ //mpm::types::regs_iface::sptr _phdac_ctrl;
+ };
+
+}}; /* namespace mpm::dboards */
+
+#ifdef LIBMPM_PYTHON
+void export_eiscat(){
+ LIBMPM_BOOST_PREAMBLE("eiscat")
+ using namespace mpm::dboards;
+ bp::class_<mpm::dboards::eiscat_manager>("eiscat_manager", bp::init<std::string, std::string, std::string>())
+ .def("get_spi_lock", &mpm::dboards::eiscat_manager::get_spi_lock)
+ .def("get_clock_ctrl", &mpm::dboards::eiscat_manager::get_clock_ctrl)
+ .def("get_adc0_ctrl", &mpm::dboards::eiscat_manager::get_adc0_ctrl)
+ .def("get_adc1_ctrl", &mpm::dboards::eiscat_manager::get_adc1_ctrl)
+ ;
+}
+#endif