22 #ifndef GNSS_SDR_AD9361_MANAGER_H 23 #define GNSS_SDR_AD9361_MANAGER_H 29 #define FIR_BUF_SIZE 8192 48 void errchk(
int v,
const char *what);
51 void wr_ch_lli(
struct iio_channel *chn,
const char *what, int64_t val);
54 void wr_ch_str(
struct iio_channel *chn,
const char *what,
const char *str);
57 struct iio_device *get_ad9361_phy(
struct iio_context *ctx);
60 bool get_ad9361_stream_dev(
struct iio_context *ctx,
enum iodev d,
struct iio_device **dev);
63 bool get_ad9361_stream_ch(
struct iio_context *ctx,
enum iodev d,
struct iio_device *dev,
int chid,
struct iio_channel **chn);
66 bool get_phy_chan(
struct iio_context *ctx,
enum iodev d,
int chid,
struct iio_channel **chn);
69 bool get_lo_chan(
struct iio_context *ctx,
enum iodev d,
struct iio_channel **chn);
72 bool cfg_ad9361_streaming_ch(
struct iio_context *ctx,
struct stream_cfg *cfg,
enum iodev type,
int chid);
74 bool config_ad9361_rx_local(uint64_t bandwidth_,
75 uint64_t sample_rate_,
77 const std::string &rf_port_select_,
80 const std::string &gain_mode_rx1_,
81 const std::string &gain_mode_rx2_,
87 std::string filter_source_,
88 std::string filter_filename_,
92 bool config_ad9361_rx_remote(
const std::string &remote_host,
94 uint64_t sample_rate_,
96 const std::string &rf_port_select_,
99 const std::string &gain_mode_rx1_,
100 const std::string &gain_mode_rx2_,
106 std::string filter_source_,
107 std::string filter_filename_,
111 bool config_ad9361_lo_local(uint64_t bandwidth_,
112 uint64_t sample_rate_,
113 uint64_t freq_rf_tx_hz_,
114 double tx_attenuation_db_,
115 int64_t freq_dds_tx_hz_,
116 double scale_dds_dbfs_,
117 double phase_dds_deg_);
119 bool config_ad9361_lo_remote(
const std::string &remote_host,
121 uint64_t sample_rate_,
122 uint64_t freq_rf_tx_hz_,
123 double tx_attenuation_db_,
124 int64_t freq_dds_tx_hz_,
125 double scale_dds_dbfs_,
126 double phase_dds_deg_);
128 bool ad9361_disable_lo_remote(
const std::string &remote_host);
130 bool ad9361_disable_lo_local();
132 bool load_fir_filter(std::string &filter,
struct iio_device *phy);
134 bool disable_ad9361_rx_local();
136 bool disable_ad9361_rx_remote(
const std::string &remote_host);
138 #endif // GNSS_SDR_AD9361_MANAGER_H