diff options
author | Josh Blum <josh@joshknows.com> | 2010-06-04 12:32:06 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-06-04 12:32:06 -0700 |
commit | 4f0736ef7ce93d58f0768d99257b2624d5711490 (patch) | |
tree | 7005a25929aa0e6ef27825087a88f1eaa27976d3 | |
parent | 89541d92664b98d8763492d4585eb2528df9e1f3 (diff) | |
download | uhd-4f0736ef7ce93d58f0768d99257b2624d5711490.tar.gz uhd-4f0736ef7ce93d58f0768d99257b2624d5711490.tar.bz2 uhd-4f0736ef7ce93d58f0768d99257b2624d5711490.zip |
move get clock rate into clock control
-rw-r--r-- | host/lib/usrp/usrp2/clock_ctrl.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/clock_ctrl.hpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/dboard_iface.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_iface.cpp | 7 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_iface.hpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.hpp | 4 |
6 files changed, 13 insertions, 16 deletions
diff --git a/host/lib/usrp/usrp2/clock_ctrl.cpp b/host/lib/usrp/usrp2/clock_ctrl.cpp index 94920143d..d9baa66cf 100644 --- a/host/lib/usrp/usrp2/clock_ctrl.cpp +++ b/host/lib/usrp/usrp2/clock_ctrl.cpp @@ -110,6 +110,10 @@ public: this->update_regs(); } + double get_master_clock_rate(void){ + return 100e6; + } + private: /*! * Write a single register to the spi regs. diff --git a/host/lib/usrp/usrp2/clock_ctrl.hpp b/host/lib/usrp/usrp2/clock_ctrl.hpp index 122b5e633..0ad8d9532 100644 --- a/host/lib/usrp/usrp2/clock_ctrl.hpp +++ b/host/lib/usrp/usrp2/clock_ctrl.hpp @@ -34,6 +34,12 @@ public: static sptr make(usrp2_iface::sptr iface); /*! + * Get the master clock frequency for the fpga. + * \return the clock frequency in Hz + */ + virtual double get_master_clock_rate(void) = 0; + + /*! * Enable/disable the rx dboard clock. * \param enb true to enable */ diff --git a/host/lib/usrp/usrp2/dboard_iface.cpp b/host/lib/usrp/usrp2/dboard_iface.cpp index 5933f8e40..feee0a970 100644 --- a/host/lib/usrp/usrp2/dboard_iface.cpp +++ b/host/lib/usrp/usrp2/dboard_iface.cpp @@ -117,7 +117,7 @@ usrp2_dboard_iface::~usrp2_dboard_iface(void){ * Clocks **********************************************************************/ double usrp2_dboard_iface::get_clock_rate(unit_t){ - return _iface->get_master_clock_freq(); + return _clock_ctrl->get_master_clock_rate(); } void usrp2_dboard_iface::set_clock_enabled(unit_t unit, bool enb){ diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp index e12c84d45..6e0d3266a 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.cpp +++ b/host/lib/usrp/usrp2/usrp2_iface.cpp @@ -166,13 +166,6 @@ public: throw std::runtime_error("usrp2 no control response"); } -/*********************************************************************** - * Master Clock! Ahhhhh - **********************************************************************/ - double get_master_clock_freq(void){ - return 100e6; - } - private: //this lovely lady makes it all possible transport::udp_simple::sptr _ctrl_transport; diff --git a/host/lib/usrp/usrp2/usrp2_iface.hpp b/host/lib/usrp/usrp2/usrp2_iface.hpp index caf6623e2..7b2a3a89d 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.hpp +++ b/host/lib/usrp/usrp2/usrp2_iface.hpp @@ -108,12 +108,6 @@ public: size_t num_bits, bool readback ) = 0; - - /*! - * Get the master clock frequency. - * \return the frequency in Hz - */ - virtual double get_master_clock_freq(void) = 0; }; #endif /* INCLUDED_USRP2_IFACE_HPP */ diff --git a/host/lib/usrp/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp index 90306a85f..6ad151a0a 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.hpp +++ b/host/lib/usrp/usrp2/usrp2_impl.hpp @@ -124,8 +124,8 @@ public: ); private: - double get_master_clock_freq(void){ - return _iface->get_master_clock_freq(); + inline double get_master_clock_freq(void){ + return _clock_ctrl->get_master_clock_rate(); } //device properties interface |