aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_dbsrx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/dboard/db_dbsrx.cpp')
-rw-r--r--host/lib/usrp/dboard/db_dbsrx.cpp27
1 files changed, 8 insertions, 19 deletions
diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp
index 99137dda3..0b8b4db83 100644
--- a/host/lib/usrp/dboard/db_dbsrx.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx.cpp
@@ -69,7 +69,7 @@ public:
private:
double _lo_freq;
- float _bandwidth;
+ double _bandwidth;
uhd::dict<std::string, float> _gains;
max2118_write_regs_t _max2118_write_regs;
max2118_read_regs_t _max2118_read_regs;
@@ -79,7 +79,7 @@ private:
void set_lo_freq(double target_freq);
void set_gain(float gain, const std::string &name);
- void set_bandwidth(float bandwidth);
+ void set_bandwidth(double bandwidth);
void send_reg(boost::uint8_t start_reg, boost::uint8_t stop_reg){
start_reg = boost::uint8_t(std::clip(int(start_reg), 0x0, 0x5));
@@ -162,15 +162,10 @@ static dboard_base::sptr make_dbsrx(dboard_base::ctor_args_t args){
return dboard_base::sptr(new dbsrx(args));
}
-//dbid for USRP2 version
UHD_STATIC_BLOCK(reg_dbsrx_dboard){
- //register the factory function for the rx dbid
+ //register the factory function for the rx dbid (others version)
dboard_manager::register_dboard(0x000D, &make_dbsrx, "DBSRX");
-}
-
-//dbid for USRP1 version
-UHD_STATIC_BLOCK(reg_dbsrx_on_usrp1_dboard){
- //register the factory function for the rx dbid
+ //register the factory function for the rx dbid (USRP1 version)
dboard_manager::register_dboard(0x0002, &make_dbsrx, "DBSRX");
}
@@ -482,9 +477,9 @@ void dbsrx::set_gain(float gain, const std::string &name){
/***********************************************************************
* Bandwidth Handling
**********************************************************************/
-void dbsrx::set_bandwidth(float bandwidth){
+void dbsrx::set_bandwidth(double bandwidth){
//clip the input
- bandwidth = std::clip<float>(bandwidth, 4e6, 33e6);
+ bandwidth = std::clip<double>(bandwidth, 4e6, 33e6);
double ref_clock = this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX);
@@ -494,7 +489,7 @@ void dbsrx::set_bandwidth(float bandwidth){
_max2118_write_regs.f_dac = std::clip<int>(int((((bandwidth*_max2118_write_regs.m_divider)/ref_clock) - 4)/0.145),0,127);
//determine actual bandwidth
- _bandwidth = float((ref_clock/(_max2118_write_regs.m_divider))*(4+0.145*_max2118_write_regs.f_dac));
+ _bandwidth = double((ref_clock/(_max2118_write_regs.m_divider))*(4+0.145*_max2118_write_regs.f_dac));
if (dbsrx_debug) std::cerr << boost::format(
"DBSRX Filter Bandwidth: %f MHz, m: %d, f_dac: %d\n"
@@ -565,12 +560,6 @@ void dbsrx::rx_get(const wax::obj &key_, wax::obj &val){
val = this->get_locked();
return;
-/*
- case SUBDEV_PROP_RSSI:
- val = this->get_rssi();
- return;
-*/
-
case SUBDEV_PROP_BANDWIDTH:
val = _bandwidth;
return;
@@ -597,7 +586,7 @@ void dbsrx::rx_set(const wax::obj &key_, const wax::obj &val){
return; //always enabled
case SUBDEV_PROP_BANDWIDTH:
- this->set_bandwidth(val.as<float>());
+ this->set_bandwidth(val.as<double>());
return;
default: UHD_THROW_PROP_SET_ERROR();