GNU Radio's LIMESDR Package
source_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2018 Lime Microsystems info@limemicro.com
4  *
5  * GNU Radio 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  * GNU Radio 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 GNU Radio; 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 #ifndef INCLUDED_LIMESDR_SOURCE_IMPL_H
22 #define INCLUDED_LIMESDR_SOURCE_IMPL_H
23 
24 #include <limesdr/source.h>
25 #include "common/device_handler.h"
26 
27 namespace gr
28 {
29  namespace limesdr
30  {
31  class source_impl : public source
32  {
33  private:
34  lms_stream_t streamId[2];
35  uint32_t fifosize = 4096*10;
36 
37 
38 
39  int LMS_CH_0 = 0;
40  int LMS_CH_1 = 1;
41  int source_block = 1;
42 
43  struct constant_data
44  {
45  int device_number;
46  int device_type;
47  int chip_mode;
48  int channel;
49  } stored;
50 
51  public:
52  source_impl(int device_number,
53  int device_type,
54  int chip_mode,
55  int channel,
56  int file_switch,
57  const char *filename,
58  double rf_freq,
59  double samp_rate,
60  size_t oversample,
61  int calibration_ch0,
62  double calibr_bandw_ch0,
63  int calibration_ch1,
64  double calibr_bandw_ch1,
65  int lna_path_mini,
66  int lna_path_ch0,
67  int lna_path_ch1,
68  int analog_filter_ch0,
69  double analog_bandw_ch0,
70  int analog_filter_ch1,
71  double analog_bandw_ch1,
72  int digital_filter_ch0,
73  double digital_bandw_ch0,
74  int digital_filter_ch1,
75  double digital_bandw_ch1,
76  int gain_dB_ch0,
77  int gain_dB_ch1);
78  ~source_impl();
79 
80  int work(int noutput_items,
81  gr_vector_const_void_star &input_items,
82  gr_vector_void_star &output_items);
83 
84  bool start(void);
85 
86  bool stop(void);
87 
88  void init_stream(int device_number, int channel);
89 
90  inline gr::io_signature::sptr args_to_io_signature(int channel_number);
91  };
92  }
93 }
94 
95 #endif
96 
void init_stream(int device_number, int channel)
Definition: sink.h:27
Definition: source.h:31
gr::io_signature::sptr args_to_io_signature(int channel_number)
source_impl(int device_number, int device_type, int chip_mode, int channel, int file_switch, const char *filename, double rf_freq, double samp_rate, size_t oversample, int calibration_ch0, double calibr_bandw_ch0, int calibration_ch1, double calibr_bandw_ch1, int lna_path_mini, int lna_path_ch0, int lna_path_ch1, int analog_filter_ch0, double analog_bandw_ch0, int analog_filter_ch1, double analog_bandw_ch1, int digital_filter_ch0, double digital_bandw_ch0, int digital_filter_ch1, double digital_bandw_ch1, int gain_dB_ch0, int gain_dB_ch1)
Definition: source_impl.h:31
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)