GNU Radio 3.3.0 C++ API
db_wbxng.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 //
00003 // Copyright 2009 Free Software Foundation, Inc.
00004 //
00005 // This file is part of GNU Radio
00006 //
00007 // GNU Radio is free software; you can redistribute it and/or modify
00008 // it under the terms of the GNU General Public License as published by
00009 // the Free Software Foundation; either asversion 3, or (at your option)
00010 // any later version.
00011 //
00012 // GNU Radio is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with GNU Radio; see the file COPYING.  If not, write to
00019 // the Free Software Foundation, Inc., 51 Franklin Street,
00020 // Boston, MA 02110-1301, USA.
00021 
00022 #ifndef INCLUDED_DB_WBXNG_H
00023 #define INCLUDED_DB_WBXNG_H
00024 
00025 #include <usrp/db_base.h>
00026 #include <cmath>
00027 
00028 class adf4350;
00029 
00030 class wbxng_base : public db_base
00031 {
00032 public:
00033   wbxng_base(usrp_basic_sptr usrp, int which, int _power_on=0);
00034   ~wbxng_base();
00035 
00036   struct freq_result_t set_freq(double freq);
00037 
00038   bool  is_quadrature();
00039   double freq_min();
00040   double freq_max();
00041 
00042 protected:
00043   bool _lock_detect();
00044   bool _set_pga(float pga_gain);
00045 
00046   int power_on() { return d_power_on; }
00047   int power_off() { return 0; }
00048 
00049   bool d_first;
00050   int  d_spi_format;
00051   int  d_spi_enable;
00052   int  d_power_on;
00053   int  d_PD;
00054 
00055   adf4350 *d_common;
00056 };
00057 
00058 // ----------------------------------------------------------------
00059 
00060 class wbxng_base_tx : public wbxng_base
00061 {
00062 protected:
00063   void shutdown();
00064 
00065 public:
00066   wbxng_base_tx(usrp_basic_sptr usrp, int which, int _power_on=0);
00067   ~wbxng_base_tx();
00068 
00069   float gain_min();
00070   float gain_max();
00071   float gain_db_per_step();
00072 
00073   bool set_auto_tr(bool on);
00074   bool set_enable(bool on);
00075   bool set_gain(float gain);
00076 };
00077 
00078 class wbxng_base_rx : public wbxng_base
00079 {
00080 protected:
00081   void shutdown();
00082   bool _set_attn(float attn);
00083 
00084 public:
00085   wbxng_base_rx(usrp_basic_sptr usrp, int which, int _power_on=0);
00086   ~wbxng_base_rx();
00087 
00088   bool set_auto_tr(bool on);
00089   bool select_rx_antenna(int which_antenna);
00090   bool select_rx_antenna(const std::string &which_antenna);
00091   bool set_gain(float gain);
00092 };
00093 
00094 // ----------------------------------------------------------------
00095 
00096 class db_wbxng_tx : public wbxng_base_tx
00097 {
00098  public:
00099   db_wbxng_tx(usrp_basic_sptr usrp, int which);
00100   ~db_wbxng_tx();
00101 };
00102 
00103 class db_wbxng_rx : public wbxng_base_rx
00104 {
00105 public:
00106   db_wbxng_rx(usrp_basic_sptr usrp, int which);
00107   ~db_wbxng_rx();
00108 
00109   float gain_min();
00110   float gain_max();
00111   float gain_db_per_step();
00112   bool i_and_q_swapped();
00113 };
00114 
00115 #endif /* INCLUDED_DB_WBXNG_H */