GNU Radio's FUNCUBE Package
fcdpp.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_FCDPP_H
9#define INCLUDED_FUNCUBE_FCDPP_H
10
11#include <gnuradio/hier_block2.h>
12#include <funcube/api.h>
13
14namespace gr {
15namespace funcube {
16
17/*!
18 * \brief Funcube Pro+ Dongle source block.
19 *
20 * This class provides a source block for the Funcube Pro+ Dongle by wrapping the
21 * alsa audio interface and the USB control interface of the Funcube Dongle
22 * into one convenient source block.
23 * The hadware audio device is autodetected by the card name. If more than one Pro+ are
24 * connected it takes the first card.
25 * The block was tested with firmware version 20.3
26 *
27 * \ingroup funcube
28 *
29 */
30class FUNCUBE_API fcdpp : virtual public gr::hier_block2
31{
32public:
33 typedef std::shared_ptr<fcdpp> sptr;
34
35 /*!
36 * \brief Return a shared_ptr to a new instance of funcube::fcdpp.
37 *
38 * To avoid accidental use of raw pointers, funcube::fcdpp's
39 * constructor is in a private implementation
40 * class. funcube::fcdpp::make is the public interface for
41 * creating new instances.
42 */
43 static sptr make(const std::string device_name = "", int unit = 1);
44
45 /*! \brief Set frequency with resolution defined by unit.
46 * \param freq The frequency in unit Hz
47 *
48 * Sets the frequency of the Funcube Dongle with Hz or Khz resolution
49 * depending on the unit parameter ( 1: Hz , 1000 Khz )
50 * applying the frequency correction set by set_freq_corr().
51 *
52 */
53 virtual void set_freq(double freq) = 0;
54
55 /*! \brief Switches the LNA on/off.
56 * \param gain lna on/off.
57 *
58 */
59 virtual void set_lna(int gain) = 0;
60
61 /*! \brief Switches mixer gain onf/off.
62 * \param gain true means on.
63 *
64 */
65 virtual void set_mixer_gain(int gain) = 0;
66
67 /*! \brief Set new frequency correction.
68 * \param ppm The new frequency correction in parts per million
69 *
70 * Funcube recommends 0 for the Pro+.
71 *
72 * Ref: http://www.funcubedongle.com/MyImages/FCD2ManualV4.pdf
73 */
74 virtual void set_freq_corr(double ppm) = 0;
75
76 /*! \brief Set If gain.
77 * \param gain The If gain value between 0 and 59 db
78 *
79 */
80 virtual void set_if_gain(int gain) = 0;
81};
82
83} // namespace funcube
84} // namespace gr
85
86#endif /* INCLUDED_FUNCUBE_FCDPP_H */
#define FUNCUBE_API
Definition api.h:19
Funcube Pro+ Dongle source block.
Definition fcdpp.h:31
std::shared_ptr< fcdpp > sptr
Definition fcdpp.h:33
virtual void set_if_gain(int gain)=0
Set If gain.
static sptr make(const std::string device_name="", int unit=1)
Return a shared_ptr to a new instance of funcube::fcdpp.
virtual void set_mixer_gain(int gain)=0
Switches mixer gain onf/off.
virtual void set_freq(double freq)=0
Set frequency with resolution defined by unit.
virtual void set_freq_corr(double ppm)=0
Set new frequency correction.
virtual void set_lna(int gain)=0
Switches the LNA on/off.
Definition fcd.h:14