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