eaf2741c125f2ce9654e42a206dfb8a4389d9e29
[debian/gnuradio] / gr-vrt / src / vrt_quadradio_source_32fc.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2009 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
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 version 3, or (at your option)
10  * any later version.
11  * 
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.
16  * 
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 #ifndef INCLUDED_VRT_QUADRADIO_SOURCE_32FC_H
22 #define INCLUDED_VRT_QUADRADIO_SOURCE_32FC_H
23
24 #include <vrt_source_32fc.h>
25
26 namespace vrt {
27   class quadradio;
28 };
29
30 class vrt_quadradio_source_32fc;
31 typedef boost::shared_ptr<vrt_quadradio_source_32fc> vrt_quadradio_source_32fc_sptr;
32
33 vrt_quadradio_source_32fc_sptr
34 vrt_make_quadradio_source_32fc(const std::string &ip,
35                                size_t rx_bufsize = 0,
36                                size_t samples_per_pkt = 0,
37                    int rxdspno = 0);
38
39 class vrt_quadradio_source_32fc : public vrt_source_32fc
40 {
41   size_t                                d_samples_per_pkt;
42   boost::shared_ptr<vrt::quadradio>     d_qr;
43   int d_rxdspno;
44
45   vrt_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize,
46                             size_t samples_per_pkt, int rxdspno);
47
48   friend vrt_quadradio_source_32fc_sptr
49   vrt_make_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize,
50                                  size_t samples_per_pkt, int rxdspno);
51
52 public:
53   virtual ~vrt_quadradio_source_32fc();
54   virtual vrt::rx::sptr vrt_rx() const;
55
56   /*!
57    * \brief Called by scheduler when starting flowgraph
58    */
59   virtual bool start();
60   
61   /*!
62    * \brief Called by scheduler when stopping flowgraph
63    */
64   virtual bool stop();
65
66   /*!
67    * \brief Set the LO frequency (actually just sets the band select for now).
68    */
69   bool set_center_freq(double target_freq);
70
71   /*!
72    * \brief Set the band select dboard bits.
73    */
74   bool set_band_select(int band);
75   int get_band_select(void);
76
77   /*!
78    * \brief Turn the 10 dB attenuation on/off.
79    */
80   //void set_10dB_atten(bool on);
81
82   /*!
83    * \brief Set the antenna type to the main rf or calibrator.
84    * \param ant "rf" or "cal"
85    */
86   bool select_rx_antenna(const std::string &ant);
87
88   /*!
89    * \brief Set the attenuation.
90    * \param attenuation 0 to 31 in dB
91    */
92   bool set_attenuation0(int attenuation);
93   bool set_attenuation1(int attenuation);
94
95   void set_iq_imbal_taps(const std::vector<gr_complex> taps);
96
97   void set_adc_gain(bool on);
98   void set_dc_offset_comp(bool on);
99   void set_digital_gain(float gain);
100   void set_test_signal(int type);
101
102   bool set_setting_reg(int regno, int value);
103
104   /*!
105    * \brief write \p v to daugherboard control setting register
106    */
107   bool set_dboard_pins(int which_dboard, int v);
108   bool set_hsadc_conf(int which_dboard, int regno, int value);
109   bool set_lsdac(int which_dboard, int which_dac, int value);
110   bool set_mem32(int addr, int value);
111   bool set_lo_freq(double freq);
112   bool set_cal_freq(double freq);
113   bool set_beamforming(std::vector<gr_complex> gains);
114   bool set_cal_enb(bool enb);
115 };
116
117
118
119 #endif /* INCLUDED_VRT_QUADRADIO_SOURCE_32FC_H */