aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/codec_impl.cpp
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-07-28 15:40:43 -0700
committerNick Foster <nick@nerdnetworks.org>2010-07-28 15:40:43 -0700
commit8784cf70df692066f224ddf58d624b148ea98301 (patch)
treedf0ea9bc2594316da79997933e0dd117a52d8311 /host/lib/usrp/usrp2/codec_impl.cpp
parente5722d61aa2b523991f5388d9bda0f56f43f79bd (diff)
downloaduhd-8784cf70df692066f224ddf58d624b148ea98301.tar.gz
uhd-8784cf70df692066f224ddf58d624b148ea98301.tar.bz2
uhd-8784cf70df692066f224ddf58d624b148ea98301.zip
ADC gain control works.
Separated digital gain and fine gain correction into separate buckets. Changed the rounding policy of gain_group to floor() rather than round().
Diffstat (limited to 'host/lib/usrp/usrp2/codec_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/codec_impl.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/host/lib/usrp/usrp2/codec_impl.cpp b/host/lib/usrp/usrp2/codec_impl.cpp
index 5cc7a47ec..969b5b4b9 100644
--- a/host/lib/usrp/usrp2/codec_impl.cpp
+++ b/host/lib/usrp/usrp2/codec_impl.cpp
@@ -30,8 +30,9 @@ using namespace boost::assign;
//this only applies to USRP2P
static const uhd::dict<std::string, gain_range_t> codec_rx_gain_ranges = map_list_of
- ("analog", gain_range_t(0, 3.5, float(3.5)))
- ("digital", gain_range_t(0, 6.45, float(0.05)));
+ ("analog", gain_range_t(0, 3.5, 3.5))
+ ("digital", gain_range_t(0, 6.0, 0.5))
+ ("digital-fine", gain_range_t(0, 0.5, 0.05));
/***********************************************************************
@@ -99,7 +100,7 @@ void usrp2_mboard_impl::rx_codec_set(const wax::obj &key_, const wax::obj &val){
if(_iface->get_hw_rev() < USRP2P_FIRST_HW_REV) UHD_THROW_PROP_SET_ERROR();//this capability is only found in USRP2P
gain = val.as<float>();
- this->rx_codec_set_gain(gain, name); //okay. we can either have ONE gain and let codec_ctrl do the sorting between analog/digital gains, or we can have TWO gains and do the priority somewhere else.
+ this->rx_codec_set_gain(gain, name);
return;
default:
@@ -124,6 +125,10 @@ void usrp2_mboard_impl::rx_codec_set_gain(float gain, const std::string &name){
_codec_ctrl->set_rx_digital_gain(gain);
return;
}
+ if(name == "digital-fine") {
+ _codec_ctrl->set_rx_digital_fine_gain(gain);
+ return;
+ }
UHD_THROW_PROP_SET_ERROR();
}