20 #ifndef GNSS_SDR_AD9361_MANAGER_H 21 #define GNSS_SDR_AD9361_MANAGER_H 33 #define FIR_BUF_SIZE 8192 52 void errchk(
int v,
const char *what);
55 void wr_ch_lli(
struct iio_channel *chn,
const char *what, int64_t val);
58 void wr_ch_str(
struct iio_channel *chn,
const char *what,
const char *str);
61 struct iio_device *get_ad9361_phy(
struct iio_context *ctx);
64 bool get_ad9361_stream_dev(
struct iio_context *ctx,
enum iodev d,
struct iio_device **dev);
67 bool get_ad9361_stream_ch(
struct iio_context *ctx,
enum iodev d,
struct iio_device *dev,
int chid,
struct iio_channel **chn);
70 bool get_phy_chan(
struct iio_context *ctx,
enum iodev d,
int chid,
struct iio_channel **chn);
73 bool get_lo_chan(
struct iio_context *ctx,
enum iodev d,
struct iio_channel **chn);
76 bool cfg_ad9361_streaming_ch(
struct iio_context *ctx,
struct stream_cfg *cfg,
enum iodev type,
int chid);
78 bool config_ad9361_rx_local(uint64_t bandwidth_,
79 uint64_t sample_rate_,
81 const std::string &rf_port_select_,
84 const std::string &gain_mode_rx1_,
85 const std::string &gain_mode_rx2_,
91 std::string filter_source_,
92 std::string filter_filename_,
96 bool config_ad9361_rx_remote(
const std::string &remote_host,
98 uint64_t sample_rate_,
100 const std::string &rf_port_select_,
103 const std::string &gain_mode_rx1_,
104 const std::string &gain_mode_rx2_,
110 std::string filter_source_,
111 std::string filter_filename_,
115 bool config_ad9361_lo_local(uint64_t bandwidth_,
116 uint64_t sample_rate_,
117 uint64_t freq_rf_tx_hz_,
118 double tx_attenuation_db_,
119 int64_t freq_dds_tx_hz_,
120 double scale_dds_dbfs_,
121 double phase_dds_deg_);
123 bool config_ad9361_lo_remote(
const std::string &remote_host,
125 uint64_t sample_rate_,
126 uint64_t freq_rf_tx_hz_,
127 double tx_attenuation_db_,
128 int64_t freq_dds_tx_hz_,
129 double scale_dds_dbfs_,
130 double phase_dds_deg_);
132 bool ad9361_disable_lo_remote(
const std::string &remote_host);
134 bool ad9361_disable_lo_local();
136 bool load_fir_filter(std::string &filter,
struct iio_device *phy);
138 bool disable_ad9361_rx_local();
140 bool disable_ad9361_rx_remote(
const std::string &remote_host);
145 #endif // GNSS_SDR_AD9361_MANAGER_H