From b9f9ca2d0fd43f2a55e4ed5301070585cbb1be3c Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 6 Aug 2020 20:55:35 +0200 Subject: uhd: Add APIs for getting the available power range The previously added APIs for getting/setting power reference levels was missing an option to read back the currently available power levels (minimum and maximum power levels). This adds getters for TX and RX power ranges to multi_usrp and radio_control. The power API is thus now more similar to the gain API, which always had getters for gain ranges. --- host/include/uhd/rfnoc/radio_control.hpp | 22 ++++++++++++++++++++++ host/include/uhd/usrp/multi_usrp.hpp | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) (limited to 'host/include') diff --git a/host/include/uhd/rfnoc/radio_control.hpp b/host/include/uhd/rfnoc/radio_control.hpp index 67ddbd47d..3e05e1b91 100644 --- a/host/include/uhd/rfnoc/radio_control.hpp +++ b/host/include/uhd/rfnoc/radio_control.hpp @@ -261,6 +261,17 @@ public: */ virtual std::vector get_tx_power_ref_keys(const size_t chan = 0) = 0; + /*! Return the available TX power range given the current configuration + * + * This will return the range of available power levels given the current + * frequency, gain profile, antenna, and whatever other settings may affect + * the available power ranges. Note that the available power range may + * change frequently, so don't assume an immutable range. + * + * \param chan The channel index + */ + virtual meta_range_t get_tx_power_range(const size_t chan) = 0; + /*! Return a list of valid RX gain names */ virtual std::vector get_rx_gain_names(const size_t chan) const = 0; @@ -381,6 +392,17 @@ public: */ virtual std::vector get_rx_power_ref_keys(const size_t chan = 0) = 0; + /*! Return the available RX power range given the current configuration + * + * This will return the range of available power levels given the current + * frequency, gain profile, antenna, and whatever other settings may affect + * the available power ranges. Note that the available power range may + * change frequently, so don't assume an immutable range. + * + * \param chan The channel index + */ + virtual meta_range_t get_rx_power_range(const size_t chan) = 0; + /*! Return a list of TX gain profiles for this radio */ virtual std::vector get_tx_gain_profile_names( diff --git a/host/include/uhd/usrp/multi_usrp.hpp b/host/include/uhd/usrp/multi_usrp.hpp index 1e2993bf4..2f441bd5a 100644 --- a/host/include/uhd/usrp/multi_usrp.hpp +++ b/host/include/uhd/usrp/multi_usrp.hpp @@ -1252,6 +1252,17 @@ public: */ virtual double get_rx_power_reference(const size_t chan = 0) = 0; + /*! Return the available RX power range given the current configuration + * + * This will return the range of available power levels given the current + * frequency, gain profile, antenna, and whatever other settings may affect + * the available power ranges. Note that the available power range may + * change frequently, so don't assume an immutable range. + * + * \param chan The channel index + */ + virtual meta_range_t get_rx_power_range(const size_t chan) = 0; + /******************************************************************* * TX methods ******************************************************************/ @@ -1500,6 +1511,17 @@ public: */ virtual double get_tx_power_reference(const size_t chan = 0) = 0; + /*! Return the available TX power range given the current configuration + * + * This will return the range of available power levels given the current + * frequency, gain profile, antenna, and whatever other settings may affect + * the available power ranges. Note that the available power range may + * change frequently, so don't assume an immutable range. + * + * \param chan The channel index + */ + virtual meta_range_t get_tx_power_range(const size_t chan) = 0; + /*! * Select the TX antenna on the frontend. * \param ant the antenna name -- cgit v1.2.3