aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/common
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-10 18:18:25 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-10 18:18:25 +0100
commit8e014a2e4b393fc388f7d64e99e13559267b8dc9 (patch)
tree9d433010b289d8e1fd24df6246f461ddc984712e /host/lib/usrp/common
parentef1576780bc927b8611640091b15f3d051cb97ad (diff)
downloaduhd-8e014a2e4b393fc388f7d64e99e13559267b8dc9.tar.gz
uhd-8e014a2e4b393fc388f7d64e99e13559267b8dc9.tar.bz2
uhd-8e014a2e4b393fc388f7d64e99e13559267b8dc9.zip
Add support for LEA-M8F GPSDO board
Diffstat (limited to 'host/lib/usrp/common')
-rw-r--r--host/lib/usrp/common/adf4001_ctrl.cpp15
-rw-r--r--host/lib/usrp/common/adf4001_ctrl.hpp1
2 files changed, 16 insertions, 0 deletions
diff --git a/host/lib/usrp/common/adf4001_ctrl.cpp b/host/lib/usrp/common/adf4001_ctrl.cpp
index 01a35dbec..8f2c47a23 100644
--- a/host/lib/usrp/common/adf4001_ctrl.cpp
+++ b/host/lib/usrp/common/adf4001_ctrl.cpp
@@ -125,6 +125,21 @@ void adf4001_ctrl::set_lock_to_ext_ref(bool external) {
program_regs();
}
+bool adf4001_ctrl::set_refclk_frequency(int refclk_kHz) {
+ if (refclk_kHz == 30720) {
+ adf4001_regs.ref_counter = 96;
+ adf4001_regs.n = 125;
+ } else if (refclk_kHz == 10000) {
+ adf4001_regs.ref_counter = 1;
+ adf4001_regs.n = 4;
+ } else {
+ return false;
+ }
+
+ program_regs();
+ return true;
+}
+
void adf4001_ctrl::program_regs(void) {
//no control over CE, only LE, therefore we use the initialization latch method
write_reg(3);
diff --git a/host/lib/usrp/common/adf4001_ctrl.hpp b/host/lib/usrp/common/adf4001_ctrl.hpp
index c6813f43c..4becb329f 100644
--- a/host/lib/usrp/common/adf4001_ctrl.hpp
+++ b/host/lib/usrp/common/adf4001_ctrl.hpp
@@ -125,6 +125,7 @@ class adf4001_ctrl {
public:
adf4001_ctrl(uhd::spi_iface::sptr _spi, int slaveno);
virtual void set_lock_to_ext_ref(bool external);
+ virtual bool set_refclk_frequency(int refclk_kHz);
private:
uhd::spi_iface::sptr spi_iface;