Merge branch 'dfsg-orig'
[debian/gnuradio] / gr-msdd6000 / src / msdd_rs_source_simple.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008 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_MSDD_RS_SOURCE_SIMPLE_H
22 #define INCLUDED_MSDD_RS_SOURCE_SIMPLE_H
23
24 #include <gr_sync_block.h>
25 #include <msdd6000_rs.h>
26 #include <boost/scoped_ptr.hpp>
27
28 class msdd_rs_source_simple;
29 typedef boost::shared_ptr<msdd_rs_source_simple> msdd_rs_source_simple_sptr;
30
31
32 // public shared_ptr constructor
33
34 msdd_rs_source_simple_sptr msdd_rs_make_source_simple ( const char *src, unsigned short port_src);
35
36
37 class msdd_rs_source_simple : public gr_sync_block {
38  private:
39   friend msdd_rs_source_simple_sptr
40   msdd_rs_make_source_simple ( const char *src, unsigned short port_src);
41
42   boost::scoped_ptr<MSDD6000_RS> rcv;
43   int d_lastseq;
44
45  protected:
46   msdd_rs_source_simple (const char *src, unsigned short port_src);
47
48  public:
49   ~msdd_rs_source_simple ();
50   bool stop();
51   bool start();
52
53   /* function starts the flow of data from the digitizer */
54   int start_data();
55   /* function stops the flow of data from the digitizer */
56   int stop_data();
57
58   // Do not need this //
59 //  bool set_decim_rate(unsigned int);
60   /* Adding functions for setting the sample rate and
61   * receiver bandwidth
62   */
63   
64   /* hardware commands -- change current state of digitizer */
65   bool set_ddc_samp_rate(double);
66   bool set_ddc_bw(double);
67   
68   bool set_rx_freq(double);
69   bool set_ddc_gain(double);
70   bool set_rf_atten(double);
71
72   int work(int, gr_vector_const_void_star&, gr_vector_void_star&);
73   
74   /* Query methods -- query current state of digitizer */
75   long  pull_adc_freq();
76   float pull_ddc_samp_rate();
77   float pull_ddc_bw();
78   float pull_rx_freq();
79   int   pull_ddc_gain();
80   int   pull_rf_atten();
81   
82   /* Pulling back gain and frequency ranges */
83   std::vector<int> gain_range();
84   std::vector<float> freq_range();
85 };
86
87 #endif /* INCLUDED_MSDD_RS__RS__SOURCE_C_H */