diff options
author | Grant Meyerhoff <grant.meyerhoff@ni.com> | 2021-08-19 14:26:35 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-09-02 13:34:02 -0500 |
commit | 18de8c32716f04fb394822921a1482aa64a0b87d (patch) | |
tree | 87b6223857474ade95188b04d16dc060e1542d01 /host/include | |
parent | 570b4c6ab30be081a0119a2bf2f1d8ee7fb7f5b9 (diff) | |
download | uhd-18de8c32716f04fb394822921a1482aa64a0b87d.tar.gz uhd-18de8c32716f04fb394822921a1482aa64a0b87d.tar.bz2 uhd-18de8c32716f04fb394822921a1482aa64a0b87d.zip |
mpmd: Add discoverable feature for trig i/o mode
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/features/discoverable_feature.hpp | 1 | ||||
-rw-r--r-- | host/include/uhd/features/trig_io_mode_iface.hpp | 40 | ||||
-rw-r--r-- | host/include/uhd/types/trig_io_mode.hpp | 20 |
3 files changed, 61 insertions, 0 deletions
diff --git a/host/include/uhd/features/discoverable_feature.hpp b/host/include/uhd/features/discoverable_feature.hpp index 8cbe8e13f..b1a03eaea 100644 --- a/host/include/uhd/features/discoverable_feature.hpp +++ b/host/include/uhd/features/discoverable_feature.hpp @@ -34,6 +34,7 @@ public: FPGA_LOAD_NOTIFICATION, ADC_SELF_CALIBRATION, REF_CLK_CALIBRATION, + TRIG_IO_MODE, }; virtual ~discoverable_feature() = default; diff --git a/host/include/uhd/features/trig_io_mode_iface.hpp b/host/include/uhd/features/trig_io_mode_iface.hpp new file mode 100644 index 000000000..53b0ff19f --- /dev/null +++ b/host/include/uhd/features/trig_io_mode_iface.hpp @@ -0,0 +1,40 @@ +// +// Copyright 2021 Ettus Research, a National Instruments Brand +// +// SPDX-License-Identifier: GPL-3.0-or-later +// + +#pragma once + +#include <uhd/features/discoverable_feature.hpp> +#include <uhd/types/trig_io_mode.hpp> +#include <memory> +#include <string> + +namespace uhd { namespace features { + +/*! Interface to provide access to set the mode of the Trig In/Out port. + * Currently, only the X4xx series of devices supports this. + */ +class trig_io_mode_iface : public discoverable_feature +{ +public: + using sptr = std::shared_ptr<trig_io_mode_iface>; + + static discoverable_feature::feature_id_t get_feature_id() + { + return discoverable_feature::TRIG_IO_MODE; + } + + std::string get_feature_name() const + { + return "Trig IO Mode"; + } + + virtual ~trig_io_mode_iface() = default; + + //! Set the mode for the trig i/o port + virtual void set_trig_io_mode(const uhd::trig_io_mode_t mode) = 0; +}; + +}} // namespace uhd::features diff --git a/host/include/uhd/types/trig_io_mode.hpp b/host/include/uhd/types/trig_io_mode.hpp new file mode 100644 index 000000000..13053e926 --- /dev/null +++ b/host/include/uhd/types/trig_io_mode.hpp @@ -0,0 +1,20 @@ +// +// Copyright 2021 Ettus Research, a National Instruments Brand +// +// SPDX-License-Identifier: GPL-3.0-or-later +// + +#pragma once + +namespace uhd { + +enum class trig_io_mode_t { + //! Output PPS signal from port + PPS_OUTPUT, + //! Use port as input + INPUT, + //! Port is turned off + OFF +}; + +} // namespace uhd |