GNU Radio's FCDPROPLUS Package
fcdproplus.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013 Volker Schroer, DL1KSV
4  *
5  * This is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3, or (at your option)
8  * any later version.
9  *
10  * This software is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this software; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 
22 #ifndef INCLUDED_FCDPROPLUS_FCDPROPLUS_H
23 #define INCLUDED_FCDPROPLUS_FCDPROPLUS_H
24 
25 #include <fcdproplus/api.h>
26 #include <gnuradio/hier_block2.h>
27 
28 #include <string>
29 
30 namespace gr {
31  namespace fcdproplus {
32 
33  /*!
34  * \brief Funcube Pro+ Dongle source block.
35  *
36  * This class provides a soure block for the Funcube Pro+ Dongle by wrapping the
37  * alsa audio interface and the USB control interface of the Funcube Dongle
38  * into one convenient source block.
39  * The hadware audio device is autodetected by the card name. If more than one Pro+ are
40  * connected it takes the first card.
41  * The block was tested with firmware version 20.3
42  *
43  * \ingroup fcdproplus
44  *
45  */
46  class FCDPROPLUS_API fcdproplus : virtual public hier_block2
47  {
48  public:
49  typedef boost::shared_ptr<fcdproplus> sptr;
50 
51  /*!
52  * \brief Return a shared_ptr to a new instance of fcdproplus::fcdproplus.
53  *
54  * To avoid accidental use of raw pointers, fcdproplus::fcdproplus's
55  * constructor is in a private implementation
56  * class. fcdproplus::fcdproplus::make is the public interface for
57  * creating new instances.
58  */
59  static sptr make(const std::string device_name = "",int unit =1 );
60 
61  /*! \brief Set frequency with resolution defined by unit.
62  * \param freq The frequency in unit Hz
63  *
64  * Sets the frequency of the Funcube Dongle with Hz or Khz resolution
65  * depending on the unit paramater ( 1: Hz , 1000 Khz )
66  * applying the frequency correction set by set_freq_corr().
67  *
68  */
69  virtual void set_freq(float freq) = 0;
70 
71  /*! \brief Switches the LNA on/off.
72  * \param gain lna on/off.
73  *
74  */
75  virtual void set_lna(int gain) = 0;
76 
77  /*! \brief Switches mixer gain onf/off.
78  * \param gain true means on.
79  *
80  */
81  virtual void set_mixer_gain(int gain) = 0;
82 
83  /*! \brief Set new frequency correction.
84  * \param ppm The new frequency correction in parts per million
85  *
86  * Funcube recommends 0 for the Pro+.
87  *
88  * Ref: http://www.funcubedongle.com/MyImages/FCD2ManualV4.pdf
89  */
90  virtual void set_freq_corr(int ppm) = 0;
91 
92  /*! \brief Set If gain.
93  * \param gain The If gain value between 0 and 59 db
94  *
95  */
96  virtual void set_if_gain(int gain)=0;
97 
98  };
99 
100  } // namespace fcdproplus
101 } // namespace gr
102 
103 #endif /* INCLUDED_FCDPROPLUS_FCDPROPLUS_H */
104 
boost::shared_ptr< fcdproplus > sptr
Definition: fcdproplus.h:49
#define FCDPROPLUS_API
Definition: api.h:30
Funcube Pro+ Dongle source block.
Definition: fcdproplus.h:46
Definition: fcdproplus.h:30