diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-11-03 16:56:03 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:05 -0800 |
commit | b5f6ba518e80fe3f3f64f112d657bc9fc631fe4f (patch) | |
tree | d228fb6365e8227cadabd1e730549c2200bef290 /host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.hpp | |
parent | f700f5a43afa8840262fadf15c4d6fd2648b298b (diff) | |
download | uhd-b5f6ba518e80fe3f3f64f112d657bc9fc631fe4f.tar.gz uhd-b5f6ba518e80fe3f3f64f112d657bc9fc631fe4f.tar.bz2 uhd-b5f6ba518e80fe3f3f64f112d657bc9fc631fe4f.zip |
mg: Refactor magnesium_radio_ctrl and friends
- Spin out AD9371 control into its own class
- Split file into multiple compilation units
- Fixed many minor code formatting issues
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.hpp')
-rw-r--r-- | host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.hpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.hpp b/host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.hpp new file mode 100644 index 000000000..9529e1519 --- /dev/null +++ b/host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.hpp @@ -0,0 +1,76 @@ +// +// Copyright 2017 Ettus Research, a National Instruments Company +// +// SPDX-License-Identifier: GPL-3.0 +// + +#ifndef INCLUDED_LIBUHD_RFNOC_MAGNESIUM_AD9371_IFACE_HPP +#define INCLUDED_LIBUHD_RFNOC_MAGNESIUM_AD9371_IFACE_HPP + +#include "../../../utils/rpc.hpp" +#include <uhd/types/direction.hpp> +#include <iostream> +#include <string> + +class magnesium_ad9371_iface +{ +public: + using uptr = std::unique_ptr<magnesium_ad9371_iface>; + + magnesium_ad9371_iface( + uhd::rpc_client::sptr rpcc, + const size_t slot_idx + ); + + double set_frequency( + const double freq, + const size_t chan, + const uhd::direction_t dir + ); + + double get_frequency( + const size_t chan, + const uhd::direction_t dir + ); + + double set_gain( + const double gain, + const size_t chan, + const uhd::direction_t dir + ); + + double get_gain( + const size_t chan, + const uhd::direction_t dir + ); + + double set_bandwidth( + const double bandwidth, + const size_t chan, + const uhd::direction_t dir + ); + + double get_bandwidth( + const size_t chan, + const uhd::direction_t dir + ); + +private: + //! Reference to the RPC client + uhd::rpc_client::sptr _rpcc; + + //! Slot index + const size_t _slot_idx; + + //! Stores the prefix to RPC calls + const std::string _rpc_prefix; + + //! Logger prefix + const std::string _L; + + + +}; + +#endif /* INCLUDED_LIBUHD_RFNOC_MAGNESIUM_AD9371_IFACE_HPP */ +// vim: sw=4 et: |