From a815bb2b6bfd772e3cb8ca61357390cd451d5ecf Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 17 Mar 2021 17:00:24 +0100 Subject: rfnoc: radio: Add getter for SPC value This adds uhd::rfnoc::radio_control::get_spc(). It can be overridden by radio implementations, but radio_control_impl has a sensible default implementation, return the value that is in the SPC radio register. --- host/lib/rfnoc/radio_control_impl.cpp | 5 +++++ host/lib/rfnoc/radio_control_python.hpp | 1 + 2 files changed, 6 insertions(+) (limited to 'host/lib/rfnoc') diff --git a/host/lib/rfnoc/radio_control_impl.cpp b/host/lib/rfnoc/radio_control_impl.cpp index 709bbd87d..0a3eda277 100644 --- a/host/lib/rfnoc/radio_control_impl.cpp +++ b/host/lib/rfnoc/radio_control_impl.cpp @@ -289,6 +289,11 @@ uhd::meta_range_t radio_control_impl::get_rate_range() const return result; } +size_t radio_control_impl::get_spc() const +{ + return _spc; +} + /**************************************************************************** * RF API ***************************************************************************/ diff --git a/host/lib/rfnoc/radio_control_python.hpp b/host/lib/rfnoc/radio_control_python.hpp index 2f76209f2..3fb6371da 100644 --- a/host/lib/rfnoc/radio_control_python.hpp +++ b/host/lib/rfnoc/radio_control_python.hpp @@ -21,6 +21,7 @@ void export_radio_control(py::module& m) .def("set_rate", &radio_control::set_rate) .def("get_rate", &radio_control::get_rate) .def("get_rate_range", &radio_control::get_rate_range) + .def("get_spc", &radio_control::get_spc) .def("get_tx_antenna", &radio_control::get_tx_antenna) .def("get_tx_antennas", &radio_control::get_tx_antennas) .def("set_tx_antenna", &radio_control::set_tx_antenna) -- cgit v1.2.3