diff options
author | Josh Blum <josh@joshknows.com> | 2010-06-10 10:10:05 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-06-10 10:10:05 -0700 |
commit | 126444c564d30d65116be5f772bdf47594d62884 (patch) | |
tree | 13c60f59f937edd34aacd58f69b03f5253f76f1f /host/lib/usrp/dsp_utils.hpp | |
parent | ad95e45ab20134657075cd30b989748597c17765 (diff) | |
download | uhd-126444c564d30d65116be5f772bdf47594d62884.tar.gz uhd-126444c564d30d65116be5f772bdf47594d62884.tar.bz2 uhd-126444c564d30d65116be5f772bdf47594d62884.zip |
Moved mux calculations into dsp type1 utils.
Fixed error in db basic freq range switcheroo.
Diffstat (limited to 'host/lib/usrp/dsp_utils.hpp')
-rw-r--r-- | host/lib/usrp/dsp_utils.hpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/host/lib/usrp/dsp_utils.hpp b/host/lib/usrp/dsp_utils.hpp index cfe5375f8..e0ec46184 100644 --- a/host/lib/usrp/dsp_utils.hpp +++ b/host/lib/usrp/dsp_utils.hpp @@ -32,6 +32,41 @@ namespace dsp_type1{ } /*! + * Calculate the rx mux word from properties. + * \param is_quadrature true if the subdev is complex + * \param is_iq_swapped true if the i and q are reversed + * \param the 32-bit rx mux control word + */ + static inline boost::uint32_t calc_rx_mux_word( + bool is_quadrature, + bool is_iq_swapped + ){ + boost::uint32_t rx_mux = 0; + if (is_quadrature){ + rx_mux = (0x01 << 2) | (0x00 << 0); //Q=ADC1, I=ADC0 + }else{ + rx_mux = (0x11 << 2) | (0x00 << 0); //Q=ZERO, I=ADC0 + } + if (is_iq_swapped){ + rx_mux = (rx_mux << 2) | (rx_mux >> 2); + } + return rx_mux; + } + + /*! + * Calculate the tx mux word from properties. + * \param is_iq_swapped true if the i and q are reversed + * \param the 32-bit tx mux control word + */ + static inline boost::uint32_t calc_tx_mux_word(bool is_iq_swapped){ + boost::uint32_t tx_mux = 0x10; + if (is_iq_swapped){ + tx_mux = (tx_mux << 4) | (tx_mux >> 4); + } + return tx_mux; + } + + /*! * Calculate the cordic word from the frequency and clock rate. * The frequency will be set to the actual (possible) frequency. * |