aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-01-04 07:21:00 -0800
committerMartin Braun <martin.braun@ettus.com>2018-01-08 15:03:48 -0800
commitab83e9259b6fc45ae8258bd0b4252e3b6d7260c5 (patch)
tree510b21acb15b3b62835f2cf8b492a9d0548c808f /host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp
parentaeb18f50a0598395d3b0a6179414f6dbfcad2d44 (diff)
downloaduhd-ab83e9259b6fc45ae8258bd0b4252e3b6d7260c5.tar.gz
uhd-ab83e9259b6fc45ae8258bd0b4252e3b6d7260c5.tar.bz2
uhd-ab83e9259b6fc45ae8258bd0b4252e3b6d7260c5.zip
mg: Use enums for all bands, move freq mapping to single location
This removes the need to re-implement the band checks (in particular, the low band check) in multiple places, potentially causing confusion. Signed-off-by: Trung Tran <trung.tran@ettus.com> Reviewed-by: Trung Tran <trung.tran@ettus.com>
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp')
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp
index 0659dad14..49affaa6f 100644
--- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp
+++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp
@@ -29,6 +29,29 @@ class magnesium_radio_ctrl_impl : public radio_ctrl_impl, public rpc_block_ctrl
public:
typedef boost::shared_ptr<magnesium_radio_ctrl_impl> sptr;
+ //! Frequency bands for RX. Bands are a function of the analog filter banks
+ enum class rx_band {
+ INVALID_BAND,
+ LOWBAND,
+ BAND0,
+ BAND1,
+ BAND2,
+ BAND3,
+ BAND4,
+ BAND5,
+ BAND6
+ };
+
+ //! Frequency bands for TX. Bands are a function of the analog filter banks
+ enum class tx_band {
+ INVALID_BAND,
+ LOWBAND,
+ BAND0,
+ BAND1,
+ BAND2,
+ BAND3
+ };
+
/************************************************************************
* Structors
***********************************************************************/
@@ -144,6 +167,13 @@ private:
const size_t chan_idx
);
+ //! Map a frequency in Hz to an rx_band value. Will return
+ // rx_band::INVALID_BAND if the frequency is out of range.
+ rx_band _map_freq_to_rx_band(const double freq);
+ //! Map a frequency in Hz to an tx_band value. Will return
+ // tx_band::INVALID_BAND if the frequency is out of range.
+ tx_band _map_freq_to_tx_band(const double freq);
+
/**************************************************************************
* Sensors
*************************************************************************/