From 0e7fe25f42105de0d01fc568cc717f9f04d825b7 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Sat, 29 Apr 2017 18:57:30 -0700 Subject: mpm: eiscat: Added first pass at EISCAT dboard driver --- mpm/include/mpm/dboards/eiscat_manager.hpp | 70 ++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 mpm/include/mpm/dboards/eiscat_manager.hpp (limited to 'mpm/include') 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 . +// + +#pragma once + +#include +#include +#include +#include + +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 _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_("eiscat_manager", bp::init()) + .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 -- cgit v1.2.3