3 // Copyright 2008 Free Software Foundation, Inc.
5 // This file is part of GNU Radio
7 // GNU Radio is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either asversion 3, or (at your option)
12 // GNU Radio is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with GNU Radio; see the file COPYING. If not, write to
19 // the Free Software Foundation, Inc., 51 Franklin Street,
20 // Boston, MA 02110-1301, USA.
23 #ifndef INCLUDED_DB_BASE_H
24 #define INCLUDED_DB_BASE_H
27 #include <boost/shared_ptr.hpp>
28 #include <boost/weak_ptr.hpp>
32 typedef boost::shared_ptr<db_base> db_base_sptr;
35 typedef boost::shared_ptr<usrp_basic> usrp_basic_sptr;
43 /******************************************************************************/
49 usrp_basic *d_raw_usrp;
53 void _enable_refclk(bool enable);
54 virtual double _refclk_freq();
55 virtual int _refclk_divisor();
62 db_base(boost::shared_ptr<usrp_basic> usrp, int which);
67 std::string side_and_name();
68 int which() { return d_which; }
70 bool bypass_adc_buffers(bool bypass);
71 bool set_atr_mask(int v);
72 bool set_atr_txval(int v);
73 bool set_atr_rxval(int v);
74 bool set_atr_tx_delay(int v);
75 bool set_atr_rx_delay(int v);
76 bool set_lo_offset(double offset);
77 double lo_offset() { return d_lo_offset; }
80 ////////////////////////////////////////////////////////
81 // derived classes should override the following methods
84 friend class usrp_basic;
87 * Called to shutdown daughterboard. Called from dtor and usrp_basic dtor.
89 * N.B., any class that overrides shutdown MUST call shutdown in its destructor.
91 virtual void shutdown();
95 virtual float gain_min() = 0;
96 virtual float gain_max() = 0;
97 virtual float gain_db_per_step() = 0;
98 virtual double freq_min() = 0;
99 virtual double freq_max() = 0;
100 virtual struct freq_result_t set_freq(double target_freq) = 0;
101 virtual bool set_gain(float gain) = 0;
102 virtual bool is_quadrature() = 0;
103 virtual bool i_and_q_swapped();
104 virtual bool spectrum_inverted();
105 virtual bool set_enable(bool on);
106 virtual bool set_auto_tr(bool on);
107 virtual bool select_rx_antenna(int which_antenna);
108 virtual bool select_rx_antenna(const std::string &which_antenna);
112 std::ostream & operator<<(std::ostream &os, db_base &x);
114 #endif /* INCLUDED_DB_BASE_H */