diff options
author | Mark Meserve <mark.meserve@ni.com> | 2017-03-23 14:49:42 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:03:44 -0800 |
commit | bc4d1bf0ca341a72a7d7f6b2168aa3d2e936aabf (patch) | |
tree | 5af9a631efc95c2a1e94e58aa1a86b84e2c91712 /mpm/include | |
parent | 1a4348038d0eb57d53475074dca49e8192aeb2d7 (diff) | |
download | uhd-bc4d1bf0ca341a72a7d7f6b2168aa3d2e936aabf.tar.gz uhd-bc4d1bf0ca341a72a7d7f6b2168aa3d2e936aabf.tar.bz2 uhd-bc4d1bf0ca341a72a7d7f6b2168aa3d2e936aabf.zip |
mpm: Rearchitecture of AD9371 code to use ctrl/device paradigm
Diffstat (limited to 'mpm/include')
-rw-r--r-- | mpm/include/mpm/spi/adi_ctrl.hpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/mpm/include/mpm/spi/adi_ctrl.hpp b/mpm/include/mpm/spi/adi_ctrl.hpp index d3269cecc..7cc87b586 100644 --- a/mpm/include/mpm/spi/adi_ctrl.hpp +++ b/mpm/include/mpm/spi/adi_ctrl.hpp @@ -17,15 +17,24 @@ #pragma once -#include <mpm/spi_iface.hpp> +// TODO: fix path of UHD include +#include <../../host/include/uhd/types/serial.hpp> -struct mpm_spiSettings_t +#include <chrono> + +struct ad9371_spiSettings_t { - static mpm_spiSettings_t* make(spiSettings_t *sps) { - return reinterpret_cast<mpm_spiSettings_t *>(sps); + static ad9371_spiSettings_t* make(spiSettings_t *sps) { + return reinterpret_cast<ad9371_spiSettings_t *>(sps); } + explicit ad9371_spiSettings_t(uhd::spi_iface::sptr uhd_iface); + + // spiSetting_t MUST be the first data member so that the + // reintrepret_cast in make() works spiSettings_t spi_settings; - mpm::spi_iface *spi_iface; + uhd::spi_iface::sptr spi_iface; + std::chrono::time_point<std::chrono::steady_clock> timeout_start; + std::chrono::microseconds timeout_duration; }; |