aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/simple_device.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-10 19:33:38 -0800
committerJosh Blum <josh@joshknows.com>2010-03-10 19:33:38 -0800
commit9c0fb5e15da3c8ccbc1c8537671703411b210fcf (patch)
treef6a516c76b2db84903a2e2e44b30af7a49997cb1 /host/lib/simple_device.cpp
parent8e9a8464386db03a596e0b88d0714d22723d37d0 (diff)
downloaduhd-9c0fb5e15da3c8ccbc1c8537671703411b210fcf.tar.gz
uhd-9c0fb5e15da3c8ccbc1c8537671703411b210fcf.tar.bz2
uhd-9c0fb5e15da3c8ccbc1c8537671703411b210fcf.zip
Filled in dboard code for basics and lf type boards.
The dboard is now just a uint16 (dont bother with the enums). The dboard manager now registers subdevs with a name. The basic board code uses a static block to register itself.
Diffstat (limited to 'host/lib/simple_device.cpp')
-rw-r--r--host/lib/simple_device.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/host/lib/simple_device.cpp b/host/lib/simple_device.cpp
index 63a17c52d..76f3c1262 100644
--- a/host/lib/simple_device.cpp
+++ b/host/lib/simple_device.cpp
@@ -179,7 +179,12 @@ public:
return get_xx_rates(_rx_ddc[std::string("decims")], _rx_ddc[std::string("rate")]);
}
- tune_result_t set_rx_freq(double target_freq, double lo_offset){
+ tune_result_t set_rx_freq(double target_freq){
+ double lo_offset = 0.0;
+ //if the local oscillator will be in the passband, use an offset
+ if (wax::cast<bool>(_rx_subdev[SUBDEV_PROP_LO_INTERFERES])){
+ lo_offset = get_rx_rate()*2.0;
+ }
return tune(target_freq, lo_offset, _rx_subdev, _rx_ddc, false/* not tx */);
}
@@ -242,7 +247,12 @@ public:
return get_xx_rates(_tx_duc[std::string("interps")], _tx_duc[std::string("rate")]);
}
- tune_result_t set_tx_freq(double target_freq, double lo_offset){
+ tune_result_t set_tx_freq(double target_freq){
+ double lo_offset = 0.0;
+ //if the local oscillator will be in the passband, use an offset
+ if (wax::cast<bool>(_tx_subdev[SUBDEV_PROP_LO_INTERFERES])){
+ lo_offset = get_tx_rate()*2.0;
+ }
return tune(target_freq, lo_offset, _tx_subdev, _tx_duc, true/* is tx */);
}