20#ifndef GNSS_SDR_AD9361_MANAGER_H
21#define GNSS_SDR_AD9361_MANAGER_H
33#define FIR_BUF_SIZE 8192
35static const std::string RX_DEV_A =
"ad9361-phy";
36static const std::string RX_DEV_B =
"ad9361-phy-B";
37static const std::string RX_STREAM_DEV =
"cf-ad9361-lpc";
38static const std::string RX_STREAM_DEV_A =
"cf-ad9361-A";
39static const std::string RX_STREAM_DEV_B =
"cf-ad9361-B";
40static const std::string TX_STREAM_DEV =
"cf-ad9361-dds-core-lpc";
59void errchk(
int v,
const char *what);
62void wr_ch_lli(
struct iio_channel *chn,
const char *what, int64_t val);
65void wr_ch_str(
struct iio_channel *chn,
const char *what,
const char *str);
68struct iio_device *get_ad9361_phy(
struct iio_context *ctx);
71bool get_ad9361_stream_dev(
struct iio_context *ctx,
enum iodev d,
struct iio_device **dev);
74bool get_ad9361_stream_ch(
struct iio_context *ctx,
enum iodev d,
struct iio_device *dev,
int chid,
struct iio_channel **chn);
77bool get_phy_chan(
struct iio_context *ctx,
enum iodev d,
int chid,
struct iio_channel **chn);
80bool get_lo_chan(
struct iio_context *ctx,
enum iodev d,
struct iio_channel **chn);
83bool cfg_ad9361_streaming_ch(
struct iio_context *ctx,
struct stream_cfg *cfg,
enum iodev type,
int chid);
85bool config_ad9361_rx_local(uint64_t bandwidth_,
86 uint64_t sample_rate_,
89 const std::string &rf_port_select_,
92 const std::string &gain_mode_rx1_,
93 const std::string &gain_mode_rx2_,
99 std::string filter_source_,
100 std::string filter_filename_,
104bool config_ad9361_rx_remote(
const std::string &remote_host,
106 uint64_t sample_rate_,
108 const std::string &rf_port_select_,
111 const std::string &gain_mode_rx1_,
112 const std::string &gain_mode_rx2_,
118 std::string filter_source_,
119 std::string filter_filename_,
123bool config_ad9361_lo_local(uint64_t bandwidth_,
124 uint64_t sample_rate_,
125 uint64_t freq_rf_tx_hz_,
126 double tx_attenuation_db_,
127 int64_t freq_dds_tx_hz_,
128 double scale_dds_dbfs_,
129 double phase_dds_deg_);
131bool config_ad9361_lo_remote(
const std::string &remote_host,
133 uint64_t sample_rate_,
134 uint64_t freq_rf_tx_hz_,
135 double tx_attenuation_db_,
136 int64_t freq_dds_tx_hz_,
137 double scale_dds_dbfs_,
138 double phase_dds_deg_);
140bool ad9361_disable_lo_remote(
const std::string &remote_host);
142bool ad9361_disable_lo_local();
144bool load_fir_filter(std::string &filter,
struct iio_device *phy);
146bool disable_ad9361_rx_local();
148bool disable_ad9361_rx_remote(
const std::string &remote_host);