aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/lib/mykonos/ad937x_device.hpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-12-11 18:02:14 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:58 -0800
commitb5404ef75f8b08e51311c16c0a435b1bbb2ff807 (patch)
tree43d8c32cba6022f67b94bd443bdfffc5659aa793 /mpm/lib/mykonos/ad937x_device.hpp
parent66af893e43af6d628c40d26529c154bb7a1f6d97 (diff)
downloaduhd-b5404ef75f8b08e51311c16c0a435b1bbb2ff807.tar.gz
uhd-b5404ef75f8b08e51311c16c0a435b1bbb2ff807.tar.bz2
uhd-b5404ef75f8b08e51311c16c0a435b1bbb2ff807.zip
mpm: Fix floating-point errors in MCR configuration
Use fuzzy comparisons for setting the MCR. Reviewed-By: Trung Tran <trung.tran@ettus.com>
Diffstat (limited to 'mpm/lib/mykonos/ad937x_device.hpp')
-rw-r--r--mpm/lib/mykonos/ad937x_device.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/mpm/lib/mykonos/ad937x_device.hpp b/mpm/lib/mykonos/ad937x_device.hpp
index 9abd2942b..059079475 100644
--- a/mpm/lib/mykonos/ad937x_device.hpp
+++ b/mpm/lib/mykonos/ad937x_device.hpp
@@ -47,6 +47,13 @@ public:
CALPLL_SDM = 0x10,
};
+ enum mcr_t
+ {
+ MCR_122_88MHZ,
+ MCR_125_00MHZ,
+ MCR_153_60MHZ
+ };
+
ad937x_device(
mpm::types::regs_iface* iface,
mpm::ad937x::gpio::gain_pins_t gain_pins
@@ -97,7 +104,7 @@ public:
void update_tx_lo_source(uint8_t rxPllUseExternalLo);
uint8_t get_rx_lo_source();
uint8_t get_tx_lo_source();
- void set_master_clock_rate(const double rate);
+ void set_master_clock_rate(const mcr_t rate);
const static double MIN_FREQ;
const static double MAX_FREQ;
const static double MIN_RX_GAIN;