aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1/clock_ctrl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-31 16:29:12 -0800
committerJosh Blum <josh@joshknows.com>2011-01-31 16:29:12 -0800
commit625d5605dd157f9cf6f1d96e60a4d8d051817aef (patch)
tree4943b1d3fb498c8f36f574edeb1fb8ce7c66e323 /host/lib/usrp/usrp1/clock_ctrl.cpp
parente16445483e1505942b7b1ddcd9fc575532fd93ba (diff)
downloaduhd-625d5605dd157f9cf6f1d96e60a4d8d051817aef.tar.gz
uhd-625d5605dd157f9cf6f1d96e60a4d8d051817aef.tar.bz2
uhd-625d5605dd157f9cf6f1d96e60a4d8d051817aef.zip
usrp: added set and get master clock rates to usrp API
implemented set and get rates in usrp1 (its all soft) implemented set and get rates in usrp2 (only 100MHz)
Diffstat (limited to 'host/lib/usrp/usrp1/clock_ctrl.cpp')
-rw-r--r--host/lib/usrp/usrp1/clock_ctrl.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/host/lib/usrp/usrp1/clock_ctrl.cpp b/host/lib/usrp/usrp1/clock_ctrl.cpp
index 68c5f5320..156f2b0c4 100644
--- a/host/lib/usrp/usrp1/clock_ctrl.cpp
+++ b/host/lib/usrp/usrp1/clock_ctrl.cpp
@@ -29,32 +29,33 @@ using namespace uhd;
/***********************************************************************
* Constants
**********************************************************************/
-static const double master_clock_rate = 64e6;
+static const double default_master_clock_rate = 64e6;
/***********************************************************************
* Clock Control Implementation
**********************************************************************/
class usrp1_clock_ctrl_impl : public usrp1_clock_ctrl {
public:
- usrp1_clock_ctrl_impl(usrp1_iface::sptr iface)
- {
- _iface = iface;
+ usrp1_clock_ctrl_impl(usrp1_iface::sptr iface): _iface(iface){
+ this->set_master_clock_freq(default_master_clock_rate);
}
- double get_master_clock_freq(void)
- {
- return master_clock_rate;
+ void set_master_clock_freq(double freq){
+ _freq = freq;
+ }
+
+ double get_master_clock_freq(void){
+ return _freq;
}
private:
usrp1_iface::sptr _iface;
-
+ double _freq;
};
/***********************************************************************
* Clock Control Make
**********************************************************************/
-usrp1_clock_ctrl::sptr usrp1_clock_ctrl::make(usrp1_iface::sptr iface)
-{
+usrp1_clock_ctrl::sptr usrp1_clock_ctrl::make(usrp1_iface::sptr iface){
return sptr(new usrp1_clock_ctrl_impl(iface));
}