From 18de8c32716f04fb394822921a1482aa64a0b87d Mon Sep 17 00:00:00 2001 From: Grant Meyerhoff Date: Thu, 19 Aug 2021 14:26:35 -0500 Subject: mpmd: Add discoverable feature for trig i/o mode --- host/include/uhd/features/discoverable_feature.hpp | 1 + host/include/uhd/features/trig_io_mode_iface.hpp | 40 ++++++++++++++++++++++ host/include/uhd/types/trig_io_mode.hpp | 20 +++++++++++ 3 files changed, 61 insertions(+) create mode 100644 host/include/uhd/features/trig_io_mode_iface.hpp create mode 100644 host/include/uhd/types/trig_io_mode.hpp (limited to 'host/include') 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 +#include +#include +#include + +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; + + 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 -- cgit v1.2.3