GNU Radio's FUNCUBE Package
fcd_control.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2020 dl1ksv.
4  *
5  * SPDX-License-Identifier: GPL-3.0-or-later
6  */
7 
8 #ifndef INCLUDED_FUNCUBE_FCD_CONTROL_H
9 #define INCLUDED_FUNCUBE_FCD_CONTROL_H
10 
11 #include <gnuradio/block.h>
12 #include <funcube/api.h>
13 
14 namespace gr {
15 namespace funcube {
16 
17 /*!
18  * \brief <+description of block+>
19  * \ingroup funcube
20  *
21  */
22 class FUNCUBE_API fcd_control : virtual public gr::block
23 {
24 public:
25  typedef std::shared_ptr<fcd_control> sptr;
26 
27  /*!
28  * \brief Return a shared_ptr to a new instance of funcube::fcd_control.
29  *
30  * To avoid accidental use of raw pointers, funcube::fcd_control's
31  * constructor is in a private implementation
32  * class. funcube::fcd_control::make is the public interface for
33  * creating new instances.
34  */
35  static sptr make();
36  /*! \brief Set frequency with Hz resolution.
37  * \param freq The frequency in Hz
38  *
39  * This is a convenience function that uses float parameter in
40  * order to allow using engineering notation in GRC.
41  *
42  */
43  virtual void set_freq(float freq) = 0;
44 
45  /*! \brief Set LNA gain.
46  * \param gain The new gain in dB.
47  *
48  * Set the LNA gain in the FCD. Valid range is -5 to
49  * 30. Although the LNA gain in the FCD takes enumerated values
50  * corresponding to 2.5 dB steps, you can can call this method
51  * with any float value and it will be rounded to the nearest
52  * valid value.
53  *
54  * By default the LNA gain is set to 20 dB and this is a good value for
55  * most cases. In noisy areas you may try to reduce the gain.
56  */
57  virtual void set_lna_gain(float gain) = 0;
58 
59  /*! \brief Set mixer gain.
60  * \param gain The new gain in dB.
61  *
62  * Set the mixer gain in the FCD. Valid values are +4 and +12 dB.
63  *
64  * By default the mixer gain is set to +12 dB and this is a good
65  * value for most cases. In noisy areas you may try to reduce
66  * the gain.
67  */
68  virtual void set_mixer_gain(float gain) = 0;
69 
70  /*! \brief Set new frequency correction.
71  * \param ppm The new frequency correction in parts per million
72  *
73  * Version 1.1 FCDs (S/N 810 or later) need a correction of -12
74  * ppm. Earlier FCDs need roughly -120 ppm (default for
75  * gr-fcd).
76  *
77  * Ref: http://www.funcubedongle.com/?p=617
78  */
79  virtual void set_freq_corr(int ppm) = 0;
80 
81  /*! \brief Set DC offset correction.
82  * \param _dci DC correction for I component (-1.0 to 1.0)
83  * \param _dcq DC correction for Q component (-1.0 to 1.0)
84  *
85  * Set DC offset correction in the device. Default is 0.0.
86  */
87  virtual void set_dc_corr(double _dci, double _dcq) = 0;
88 
89  /*! \brief Set IQ phase and gain balance.
90  * \param _gain The gain correction (-1.0 to 1.0)
91  * \param _phase The phase correction (-1.0 to 1.0)
92  *
93  * Set IQ phase and gain balance in the device. The default values
94  * are 0.0 for phase and 1.0 for gain.
95  */
96  virtual void set_iq_corr(double _gain, double _phase) = 0;
97 };
98 
99 } // namespace funcube
100 } // namespace gr
101 
102 #endif /* INCLUDED_FUNCUBE_FCD_CONTROL_H */
#define FUNCUBE_API
Definition: api.h:19
<+description of block+>
Definition: fcd_control.h:23
virtual void set_lna_gain(float gain)=0
Set LNA gain.
std::shared_ptr< fcd_control > sptr
Definition: fcd_control.h:25
virtual void set_freq_corr(int ppm)=0
Set new frequency correction.
virtual void set_mixer_gain(float gain)=0
Set mixer gain.
virtual void set_dc_corr(double _dci, double _dcq)=0
Set DC offset correction.
virtual void set_freq(float freq)=0
Set frequency with Hz resolution.
static sptr make()
Return a shared_ptr to a new instance of funcube::fcd_control.
virtual void set_iq_corr(double _gain, double _phase)=0
Set IQ phase and gain balance.
Definition: fcd.h:14