diff options
author | Josh Blum <josh@joshknows.com> | 2010-06-04 01:58:12 +0000 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-06-04 01:58:12 +0000 |
commit | fcdbea4f089db2405820ad598979e639cf131ff5 (patch) | |
tree | da6b0f77c8e5202dcc141c645eedd3104beb46a8 /host/lib/usrp/usrp_e/dsp_impl.cpp | |
parent | 551426b72672379faa56302eb3d3e19d12c41aec (diff) | |
download | uhd-fcdbea4f089db2405820ad598979e639cf131ff5.tar.gz uhd-fcdbea4f089db2405820ad598979e639cf131ff5.tar.bz2 uhd-fcdbea4f089db2405820ad598979e639cf131ff5.zip |
io impl tweaks, renamed clock control and codec control implementation to avoid collision with usrp2 (those need to be renamed as well)
Diffstat (limited to 'host/lib/usrp/usrp_e/dsp_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp_e/dsp_impl.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp_e/dsp_impl.cpp b/host/lib/usrp/usrp_e/dsp_impl.cpp index 272ac71b3..e61f529ab 100644 --- a/host/lib/usrp/usrp_e/dsp_impl.cpp +++ b/host/lib/usrp/usrp_e/dsp_impl.cpp @@ -21,6 +21,30 @@ using namespace uhd::usrp; /*********************************************************************** + * Helper Functions + **********************************************************************/ +// Check if requested decim/interp rate is: +// multiple of 4, enable two halfband filters +// multiple of 2, enable one halfband filter +// handle remainder in CIC +static boost::uint32_t calculate_cic_word(size_t rate){ + int hb0 = 0, hb1 = 0; + if (not (rate & 0x1)){ + hb0 = 1; + rate /= 2; + } + if (not (rate & 0x1)){ + hb1 = 1; + rate /= 2; + } + return (hb1 << 9) | (hb0 << 8) | (rate & 0xff); +} + +static boost::uint32_t calculate_iq_scale_word(boost::int16_t i, boost::int16_t q){ + return (boost::uint16_t(i) << 16) | (boost::uint16_t(q) << 0); +} + +/*********************************************************************** * RX DDC Initialization **********************************************************************/ void usrp_e_impl::rx_ddc_init(void){ |