From fec41cd6a1ffc826a0680fd200811a4044008b72 Mon Sep 17 00:00:00 2001 From: Aaron Rossetto Date: Fri, 24 Jul 2020 10:28:07 -0500 Subject: python: Add siggen RFNoC block controller bindings --- host/lib/rfnoc/siggen_block_control_python.hpp | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 host/lib/rfnoc/siggen_block_control_python.hpp (limited to 'host/lib') diff --git a/host/lib/rfnoc/siggen_block_control_python.hpp b/host/lib/rfnoc/siggen_block_control_python.hpp new file mode 100644 index 000000000..6031878c9 --- /dev/null +++ b/host/lib/rfnoc/siggen_block_control_python.hpp @@ -0,0 +1,38 @@ +// +// Copyright 2020 Ettus Research, a National Instruments Brand +// +// SPDX-License-Identifier: GPL-3.0-or-later +// + +#pragma once + +#include "block_controller_factory_python.hpp" +#include + +using namespace uhd::rfnoc; + +void export_siggen_block_control(py::module& m) +{ + py::enum_(m, "siggen_waveform") + .value("CONSTANT", siggen_waveform::CONSTANT) + .value("SINE_WAVE", siggen_waveform::SINE_WAVE) + .value("NOISE", siggen_waveform::NOISE) + .export_values(); + + py::class_( + m, "siggen_block_control") + .def(py::init(&block_controller_factory::make_from)) + .def("set_enable", &siggen_block_control::set_enable) + .def("get_enable", &siggen_block_control::get_enable) + .def("set_waveform", &siggen_block_control::set_waveform) + .def("get_waveform", &siggen_block_control::get_waveform) + .def("set_amplitude", &siggen_block_control::set_amplitude) + .def("get_amplitude", &siggen_block_control::get_amplitude) + .def("set_constant", &siggen_block_control::set_constant) + .def("get_constant", &siggen_block_control::get_constant) + .def("set_sine_phase_increment", &siggen_block_control::set_sine_phase_increment) + .def("get_sine_phase_increment", &siggen_block_control::get_sine_phase_increment) + .def("set_sine_frequency", &siggen_block_control::set_sine_frequency) + .def("set_samples_per_packet", &siggen_block_control::set_samples_per_packet) + .def("get_samples_per_packet", &siggen_block_control::get_samples_per_packet); +} -- cgit v1.2.3