From 1e44cf9e9c46c83e9acde104478fa2bd9acadc35 Mon Sep 17 00:00:00 2001 From: Jason Abele Date: Thu, 3 Jun 2010 12:49:03 -0700 Subject: Fixing wbx to use _refclk_freq() --- usrp/host/include/usrp/db_wbxng.h | 1 + 1 file changed, 1 insertion(+) (limited to 'usrp/host/include') diff --git a/usrp/host/include/usrp/db_wbxng.h b/usrp/host/include/usrp/db_wbxng.h index 8611d4787..d0caf8b03 100644 --- a/usrp/host/include/usrp/db_wbxng.h +++ b/usrp/host/include/usrp/db_wbxng.h @@ -40,6 +40,7 @@ public: double freq_max(); protected: + int _refclk_divisor(); bool _lock_detect(); bool _set_pga(float pga_gain); -- cgit From 9004b4524713992660012d7932f6dcace74e54b0 Mon Sep 17 00:00:00 2001 From: Jason Abele Date: Thu, 3 Jun 2010 13:25:42 -0700 Subject: Clean up annoying class structure in wbx --- usrp/host/include/usrp/db_wbxng.h | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) (limited to 'usrp/host/include') diff --git a/usrp/host/include/usrp/db_wbxng.h b/usrp/host/include/usrp/db_wbxng.h index d0caf8b03..7f88c850b 100644 --- a/usrp/host/include/usrp/db_wbxng.h +++ b/usrp/host/include/usrp/db_wbxng.h @@ -30,7 +30,7 @@ class adf4350; class wbxng_base : public db_base { public: - wbxng_base(usrp_basic_sptr usrp, int which, int _power_on=0); + wbxng_base(usrp_basic_sptr usrp, int which); ~wbxng_base(); struct freq_result_t set_freq(double freq); @@ -44,9 +44,6 @@ protected: bool _lock_detect(); bool _set_pga(float pga_gain); - int power_on() { return d_power_on; } - int power_off() { return 0; } - bool d_first; int d_spi_format; int d_spi_enable; @@ -58,14 +55,14 @@ protected: // ---------------------------------------------------------------- -class wbxng_base_tx : public wbxng_base +class db_wbxng_tx : public wbxng_base { protected: void shutdown(); public: - wbxng_base_tx(usrp_basic_sptr usrp, int which, int _power_on=0); - ~wbxng_base_tx(); + db_wbxng_tx(usrp_basic_sptr usrp, int which); + ~db_wbxng_tx(); float gain_min(); float gain_max(); @@ -76,36 +73,20 @@ public: bool set_gain(float gain); }; -class wbxng_base_rx : public wbxng_base +class db_wbxng_rx : public wbxng_base { protected: void shutdown(); bool _set_attn(float attn); public: - wbxng_base_rx(usrp_basic_sptr usrp, int which, int _power_on=0); - ~wbxng_base_rx(); + db_wbxng_rx(usrp_basic_sptr usrp, int which); + ~db_wbxng_rx(); bool set_auto_tr(bool on); bool select_rx_antenna(int which_antenna); bool select_rx_antenna(const std::string &which_antenna); bool set_gain(float gain); -}; - -// ---------------------------------------------------------------- - -class db_wbxng_tx : public wbxng_base_tx -{ - public: - db_wbxng_tx(usrp_basic_sptr usrp, int which); - ~db_wbxng_tx(); -}; - -class db_wbxng_rx : public wbxng_base_rx -{ -public: - db_wbxng_rx(usrp_basic_sptr usrp, int which); - ~db_wbxng_rx(); float gain_min(); float gain_max(); -- cgit From 937b74e9f60a2668a6f39f7f5d7291a8e00aef1f Mon Sep 17 00:00:00 2001 From: Jason Abele Date: Thu, 3 Jun 2010 14:35:18 -0700 Subject: Refactor WBX and adf4350 to avoid passing usrp pointer --- usrp/host/include/usrp/db_wbxng.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usrp/host/include') diff --git a/usrp/host/include/usrp/db_wbxng.h b/usrp/host/include/usrp/db_wbxng.h index 7f88c850b..9a7829278 100644 --- a/usrp/host/include/usrp/db_wbxng.h +++ b/usrp/host/include/usrp/db_wbxng.h @@ -40,8 +40,9 @@ public: double freq_max(); protected: + void _write_spi(std::string data); int _refclk_divisor(); - bool _lock_detect(); + bool _get_locked(); bool _set_pga(float pga_gain); bool d_first; @@ -50,7 +51,7 @@ protected: int d_power_on; int d_PD; - adf4350 *d_common; + boost::shared_ptr d_common; }; // ---------------------------------------------------------------- -- cgit