aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dsp_utils.hpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-06-10 17:11:12 +0000
committerJosh Blum <josh@joshknows.com>2010-06-10 17:11:12 +0000
commit28ecca40d3e032393eb028cea9d6812b8ff80851 (patch)
tree8a923f5994ee81e600722644e08ed865d1873b8b /host/lib/usrp/dsp_utils.hpp
parenta2fb45081530fa247bd5a4c0be441fa77da0ed1b (diff)
parent126444c564d30d65116be5f772bdf47594d62884 (diff)
downloaduhd-28ecca40d3e032393eb028cea9d6812b8ff80851.tar.gz
uhd-28ecca40d3e032393eb028cea9d6812b8ff80851.tar.bz2
uhd-28ecca40d3e032393eb028cea9d6812b8ff80851.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/lib/usrp/dsp_utils.hpp')
-rw-r--r--host/lib/usrp/dsp_utils.hpp35
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.
*