39class ad936x_iio_custom
42 ad936x_iio_custom(
int debug_level_,
int log_level_);
43 virtual ~ad936x_iio_custom();
44 bool initialize_device(
const std::string &pluto_device_uri,
const std::string &board_type);
46 bool init_config_ad9361_rx(
long long bandwidth_,
47 long long sample_rate_,
49 const std::string &rf_port_select_,
50 const std::string &rf_filter,
51 const std::string &gain_mode_rx0_,
52 const std::string &gain_mode_rx1_,
58 double lo_attenuation_db_,
62 bool calibrate(
int ch,
double bw_hz);
64 double get_rx_gain(
int ch_num);
65 bool setRXGain(
int ch_num,
const std::string &gain_mode,
double gain_dB);
67 bool set_antenna_port(
int ch,
int antenna_idx);
68 double get_frequency(
int ch);
69 bool set_frequency(
int ch,
double freq_hz);
71 bool start_sample_rx(
bool ppsmode);
77 bool get_rx_frequency(
long long &freq_hz);
78 bool set_rx_frequency(
long long freq_hz);
79 bool read_die_temp(
double &temp_c);
81 void pop_sample_buffer(std::shared_ptr<ad936x_iio_samples> ¤t_buffer);
83 void push_sample_buffer(std::shared_ptr<ad936x_iio_samples> ¤t_buffer);
87 std::shared_ptr<Concurrent_Queue<GnssTime>> GnssTime_queue;
88 std::shared_ptr<Concurrent_Queue<PpsSamplestamp>> Pps_queue;
90 bool get_iio_param(iio_device *dev,
const std::string ¶m, std::string &value);
91 void configure_params(
struct iio_device *phy,
92 const std::vector<std::string> ¶ms);
93 void set_params_rx(
struct iio_device *phy_device,
94 unsigned long long frequency,
95 unsigned long samplerate,
unsigned long bandwidth,
96 bool quadrature,
bool rfdc,
bool bbdc,
97 const std::string &gain1,
double gain1_value,
98 const std::string &gain2,
double gain2_value,
99 const std::string &port_select);
101 bool config_ad9361_dds(uint64_t freq_rf_tx_hz_,
102 double tx_attenuation_db_,
103 int64_t freq_dds_tx_hz_,
105 double phase_dds_deg_,
108 void get_PPS_timestamp();
109 void capture(
const std::vector<std::string> &channels);
111 bool select_rf_filter(
const std::string &rf_filter);
113 void monitor_thread_fn();
115 void PlutoTxEnable(
bool txon);
116 void setPlutoGpo(
int p);
119 struct iio_context *ctx;
120 struct iio_device *phy;
121 struct iio_device *stream_dev;
122 struct iio_device *dds_dev;
125 std::condition_variable cv;
127 boost::atomic<bool> receive_samples;
129 boost::atomic<bool> fpga_overflow;
134 std::thread capture_samples_thread;
135 std::thread overflow_monitor_thread;
136 std::thread capture_time_thread;
139 uint64_t sample_rate_sps;