diff options
| author | Martin Braun <martin.braun@ettus.com> | 2017-03-08 09:28:55 -0800 |
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:03:44 -0800 |
| commit | 1a4348038d0eb57d53475074dca49e8192aeb2d7 (patch) | |
| tree | 04c8e87fa9c95d2702aac410f6fb271461acb9bb /mpm/n310 | |
| parent | fc8cd827f6b16b9c8c354a216889e6a9d7f37456 (diff) | |
| download | uhd-1a4348038d0eb57d53475074dca49e8192aeb2d7.tar.gz uhd-1a4348038d0eb57d53475074dca49e8192aeb2d7.tar.bz2 uhd-1a4348038d0eb57d53475074dca49e8192aeb2d7.zip | |
Initial commit for N3xx development.
- Creates mpm/ subdirectory
- First pass at hardware daemon/MPM
- New code for LMK04828, AD9371
- spidev integration
Contributions by:
Martin Braun <martin.braun@ettus.com>
Derek Kozel <derek.kozel@ettus.com>
Mark Meserve <mark.meserve@ni.com>
Andrej Rode <andrej.rode@ettus.com>
Diffstat (limited to 'mpm/n310')
| -rw-r--r-- | mpm/n310/CMakeLists.txt | 26 | ||||
| -rw-r--r-- | mpm/n310/periph_manager.cpp | 38 | ||||
| -rw-r--r-- | mpm/n310/periph_manager.hpp | 82 |
3 files changed, 146 insertions, 0 deletions
diff --git a/mpm/n310/CMakeLists.txt b/mpm/n310/CMakeLists.txt new file mode 100644 index 000000000..3177dd5b5 --- /dev/null +++ b/mpm/n310/CMakeLists.txt @@ -0,0 +1,26 @@ +# +# 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/>. +# + +######################################################################## +# This file included, use CMake directory variables +######################################################################## + + +USRP_PERIPHS_ADD_OBJECT(n310 + ${CMAKE_CURRENT_SOURCE_DIR}/periph_manager.cpp) + +TARGET_INCLUDE_DIRECTORIES(n310 PUBLIC ${UHD_HOST_ROOT}/lib/usrp/common) diff --git a/mpm/n310/periph_manager.cpp b/mpm/n310/periph_manager.cpp new file mode 100644 index 000000000..a7941774e --- /dev/null +++ b/mpm/n310/periph_manager.cpp @@ -0,0 +1,38 @@ +// +// 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/>. +// + +#include "periph_manager.hpp" + +using namespace mpm::n3xx; + +n3xx_dboard_periph_manager::n3xx_dboard_periph_manager( + uhd::spi_iface::sptr lmk_spi + //uhd::spi_iface::sptr myk_spi + //uhd::spi_iface::sptr cpld_spi + ) + { + _clock_spi = std::make_shared<lmk04828_spi_iface>(lmk04828_spi_iface(lmk_spi)); + _clock_gen = lmk04828_iface::make(_clock_spi->get_write_fn(), _clock_spi->get_read_fn()); + }; + +lmk04828_iface::sptr n3xx_dboard_periph_manager::get_clock_gen() { return _clock_gen; } + +n3xx_dboard_periph_manager periph_manager::get_dboard_A(){ + return dboard_A_manager; +} + +lmk04828_iface::sptr periph_manager::get_clock_gen(){ return dboard_A_manager.get_clock_gen(); } diff --git a/mpm/n310/periph_manager.hpp b/mpm/n310/periph_manager.hpp new file mode 100644 index 000000000..3df9aa72b --- /dev/null +++ b/mpm/n310/periph_manager.hpp @@ -0,0 +1,82 @@ +// +// 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/spi/spidev_iface.hpp" +#include "lmk/lmk04828_spi_iface.hpp" +#include <memory> + +namespace mpm { namespace n3xx { + /* + class dboard_periph_manager + { + //.... + }; + */ + /************************************************************************** + * Daughterboard peripherals + *************************************************************************/ + + /*! Encapsulates all peripherals stored on the regular N300/N310 + * daughterboard. + */ + class n3xx_dboard_periph_manager// : public dboard_periph_manager + { + public: + n3xx_dboard_periph_manager( + uhd::spi_iface::sptr lmk_spi + // uhd::spi_iface::sptr myk_spi + // uhd::spi_iface::sptr cpld_spi + + ); + + /*! Return a reference to the clock chip + */ + lmk04828_iface::sptr get_clock_gen(); + + private: + //ad937x_ctrl::sptr _rfic; + //cpld control + lmk04828_iface::sptr _clock_gen; + std::shared_ptr<lmk04828_spi_iface> _clock_spi; + }; + + /************************************************************************** + * Motherboard peripherals + *************************************************************************/ + class periph_manager + { + public: + + periph_manager(std::string spi_path): dboard_A_manager(mpm::spi::spidev_iface::make(spi_path)) + { + + }; + + n3xx_dboard_periph_manager get_dboard_A(); + lmk04828_iface::sptr get_clock_gen(); + + // virtual void set_clock_source(); + + private: + n3xx_dboard_periph_manager dboard_A_manager; + // n3xx_dboard_periph_manager dboard_B_manager; + }; + +}}; /* namespace mpm::n310 */ + |
