8 #ifndef INCLUDED_UHD_USRP_MULTI_USRP_HPP 9 #define INCLUDED_UHD_USRP_MULTI_USRP_HPP 12 #define UHD_USRP_MULTI_USRP_REF_SOURCES_API 13 #define UHD_USRP_MULTI_USRP_GET_RATES_API 14 #define UHD_USRP_MULTI_USRP_FRONTEND_CAL_API 15 #define UHD_USRP_MULTI_USRP_FRONTEND_IQ_AUTO_API 16 #define UHD_USRP_MULTI_USRP_COMMAND_TIME_API 17 #define UHD_USRP_MULTI_USRP_BW_RANGE_API 18 #define UHD_USRP_MULTI_USRP_USER_REGS_API 19 #define UHD_USRP_MULTI_USRP_GET_USRP_INFO_API 20 #define UHD_USRP_MULTI_USRP_NORMALIZED_GAIN 21 #define UHD_USRP_MULTI_USRP_GPIO_API 22 #define UHD_USRP_MULTI_USRP_REGISTER_API 23 #define UHD_USRP_MULTI_USRP_FILTER_API 24 #define UHD_USRP_MULTI_USRP_LO_CONFIG_API 37 #include <boost/shared_ptr.hpp> 38 #include <boost/utility.hpp> 96 typedef boost::shared_ptr<multi_usrp>
sptr;
101 static const size_t ALL_MBOARDS = size_t(~0);
104 static const size_t ALL_CHANS = size_t(~0);
130 virtual bool is_device3(
void) = 0;
140 virtual boost::shared_ptr<uhd::device3> get_device3(
void) = 0;
192 virtual void set_master_clock_rate(
double rate,
size_t mboard = ALL_MBOARDS) = 0;
199 virtual double get_master_clock_rate(
size_t mboard = 0) = 0;
219 virtual meta_range_t get_master_clock_rate_range(
const size_t mboard = 0) = 0;
225 virtual std::string get_pp_string(
void) = 0;
232 virtual std::string get_mboard_name(
size_t mboard = 0) = 0;
239 virtual time_spec_t get_time_now(
size_t mboard = 0) = 0;
246 virtual time_spec_t get_time_last_pps(
size_t mboard = 0) = 0;
259 virtual void set_time_now(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
273 virtual void set_time_next_pps(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
290 virtual void set_time_unknown_pps(
const time_spec_t &time_spec) = 0;
298 virtual bool get_time_synchronized(
void) = 0;
310 virtual void set_command_time(
const uhd::time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
317 virtual void clear_command_time(
size_t mboard = ALL_MBOARDS) = 0;
331 virtual void issue_stream_cmd(
const stream_cmd_t &stream_cmd,
size_t chan = ALL_CHANS) = 0;
341 virtual void set_clock_config(
const clock_config_t &clock_config,
size_t mboard = ALL_MBOARDS) = 0;
351 virtual void set_time_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
358 virtual std::string get_time_source(
const size_t mboard) = 0;
365 virtual std::vector<std::string> get_time_sources(
const size_t mboard) = 0;
374 virtual void set_clock_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
381 virtual std::string get_clock_source(
const size_t mboard) = 0;
388 virtual std::vector<std::string> get_clock_sources(
const size_t mboard) = 0;
398 virtual void set_clock_source_out(
const bool enb,
const size_t mboard = ALL_MBOARDS) = 0;
408 virtual void set_time_source_out(
const bool enb,
const size_t mboard = ALL_MBOARDS) = 0;
413 virtual size_t get_num_mboards(
void) = 0;
421 virtual sensor_value_t get_mboard_sensor(
const std::string &name,
size_t mboard = 0) = 0;
428 virtual std::vector<std::string> get_mboard_sensor_names(
size_t mboard = 0) = 0;
437 virtual void set_user_register(
const uint8_t addr,
const uint32_t data,
size_t mboard = ALL_MBOARDS) = 0;
464 virtual size_t get_rx_num_channels(
void) = 0;
471 virtual std::string get_rx_subdev_name(
size_t chan = 0) = 0;
478 virtual void set_rx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
485 virtual double get_rx_rate(
size_t chan = 0) = 0;
509 virtual double get_rx_freq(
size_t chan = 0) = 0;
520 virtual freq_range_t get_rx_freq_range(
size_t chan = 0) = 0;
527 virtual freq_range_t get_fe_rx_freq_range(
size_t chan = 0) = 0;
545 virtual std::vector<std::string> get_rx_lo_names(
size_t chan = 0) = 0;
558 virtual void set_rx_lo_source(
559 const std::string &src,
560 const std::string &name = ALL_LOS,
572 virtual const std::string get_rx_lo_source(
573 const std::string &name = ALL_LOS,
588 virtual std::vector<std::string> get_rx_lo_sources(
589 const std::string &name = ALL_LOS,
603 virtual void set_rx_lo_export_enabled(
605 const std::string &name = ALL_LOS,
614 virtual bool get_rx_lo_export_enabled(
615 const std::string &name = ALL_LOS,
642 virtual double set_rx_lo_freq(
644 const std::string &name,
658 virtual double get_rx_lo_freq(
659 const std::string &name,
673 const std::string &name,
689 virtual std::vector<std::string> get_tx_lo_names(
size_t chan = 0) = 0;
702 virtual void set_tx_lo_source(
703 const std::string &src,
704 const std::string &name = ALL_LOS,
705 const size_t chan = 0
716 virtual const std::string get_tx_lo_source(
717 const std::string &name = ALL_LOS,
718 const size_t chan = 0
731 virtual std::vector<std::string> get_tx_lo_sources(
732 const std::string &name = ALL_LOS,
733 const size_t chan = 0
746 virtual void set_tx_lo_export_enabled(
748 const std::string &name = ALL_LOS,
749 const size_t chan = 0
757 virtual bool get_tx_lo_export_enabled(
758 const std::string &name = ALL_LOS,
759 const size_t chan = 0
785 virtual double set_tx_lo_freq(
787 const std::string &name,
801 virtual double get_tx_lo_freq(
802 const std::string &name,
816 const std::string &name,
830 virtual void set_rx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
844 virtual std::vector<std::string> get_rx_gain_profile_names(
const size_t chan = 0) = 0;
851 virtual void set_rx_gain_profile(
const std::string& profile,
const size_t chan = 0) = 0;
858 virtual std::string get_rx_gain_profile(
const size_t chan = 0) = 0;
862 return this->set_rx_gain(gain, ALL_GAINS, chan);
881 virtual void set_normalized_rx_gain(
double gain,
size_t chan = 0) = 0;
891 virtual void set_rx_agc(
bool enable,
size_t chan = 0) = 0;
900 virtual double get_rx_gain(
const std::string &name,
size_t chan = 0) = 0;
904 return this->get_rx_gain(ALL_GAINS, chan);
917 virtual double get_normalized_rx_gain(
size_t chan = 0) = 0;
926 virtual gain_range_t get_rx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
930 return this->get_rx_gain_range(ALL_GAINS, chan);
939 virtual std::vector<std::string> get_rx_gain_names(
size_t chan = 0) = 0;
946 virtual void set_rx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
953 virtual std::string get_rx_antenna(
size_t chan = 0) = 0;
960 virtual std::vector<std::string> get_rx_antennas(
size_t chan = 0) = 0;
967 virtual void set_rx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
974 virtual double get_rx_bandwidth(
size_t chan = 0) = 0;
981 virtual meta_range_t get_rx_bandwidth_range(
size_t chan = 0) = 0;
998 virtual sensor_value_t get_rx_sensor(
const std::string &name,
size_t chan = 0) = 0;
1005 virtual std::vector<std::string> get_rx_sensor_names(
size_t chan = 0) = 0;
1019 virtual void set_rx_dc_offset(
const bool enb,
size_t chan = ALL_CHANS) = 0;
1028 virtual void set_rx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
1034 virtual meta_range_t get_rx_dc_offset_range(
size_t chan = ALL_CHANS) = 0;
1042 virtual void set_rx_iq_balance(
const bool enb,
size_t chan) = 0;
1051 virtual void set_rx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 0;
1078 virtual size_t get_tx_num_channels(
void) = 0;
1085 virtual std::string get_tx_subdev_name(
size_t chan = 0) = 0;
1092 virtual void set_tx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
1099 virtual double get_tx_rate(
size_t chan = 0) = 0;
1106 virtual meta_range_t get_tx_rates(
size_t chan = 0) = 0;
1123 virtual double get_tx_freq(
size_t chan = 0) = 0;
1134 virtual freq_range_t get_tx_freq_range(
size_t chan = 0) = 0;
1141 virtual freq_range_t get_fe_tx_freq_range(
size_t chan = 0) = 0;
1150 virtual void set_tx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
1164 virtual std::vector<std::string> get_tx_gain_profile_names(
const size_t chan = 0) = 0;
1171 virtual void set_tx_gain_profile(
const std::string& profile,
const size_t chan = 0) = 0;
1178 virtual std::string get_tx_gain_profile(
const size_t chan = 0) = 0;
1182 return this->set_tx_gain(gain, ALL_GAINS, chan);
1195 virtual void set_normalized_tx_gain(
double gain,
size_t chan = 0) = 0;
1204 virtual double get_tx_gain(
const std::string &name,
size_t chan = 0) = 0;
1208 return this->get_tx_gain(ALL_GAINS, chan);
1221 virtual double get_normalized_tx_gain(
size_t chan = 0) = 0;
1230 virtual gain_range_t get_tx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
1234 return this->get_tx_gain_range(ALL_GAINS, chan);
1243 virtual std::vector<std::string> get_tx_gain_names(
size_t chan = 0) = 0;
1250 virtual void set_tx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
1257 virtual std::string get_tx_antenna(
size_t chan = 0) = 0;
1264 virtual std::vector<std::string> get_tx_antennas(
size_t chan = 0) = 0;
1271 virtual void set_tx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
1278 virtual double get_tx_bandwidth(
size_t chan = 0) = 0;
1285 virtual meta_range_t get_tx_bandwidth_range(
size_t chan = 0) = 0;
1302 virtual sensor_value_t get_tx_sensor(
const std::string &name,
size_t chan = 0) = 0;
1309 virtual std::vector<std::string> get_tx_sensor_names(
size_t chan = 0) = 0;
1317 virtual void set_tx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
1323 virtual meta_range_t get_tx_dc_offset_range(
size_t chan = ALL_CHANS) = 0;
1332 virtual void set_tx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 0;
1343 virtual std::vector<std::string> get_gpio_banks(
const size_t mboard) = 0;
1361 virtual void set_gpio_attr(
const std::string &bank,
const std::string &attr,
const uint32_t value,
const uint32_t
mask = 0xffffffff,
const size_t mboard = 0) = 0;
1388 virtual void set_gpio_attr(
const std::string &bank,
const std::string &attr,
const std::string &value,
const uint32_t
mask = 0xffffffff,
const size_t mboard = 0) = 0;
1406 virtual uint32_t get_gpio_attr(
const std::string &bank,
const std::string &attr,
const size_t mboard = 0) = 0;
1433 virtual std::vector<std::string> get_gpio_string_attr(
const std::string &bank,
const std::string &attr,
const size_t mboard = 0) = 0;
1449 virtual std::vector<std::string> enumerate_registers(
const size_t mboard = 0) = 0;
1457 virtual register_info_t get_register_info(
const std::string &path,
const size_t mboard = 0) = 0;
1466 virtual void write_register(
const std::string &path,
const uint32_t field,
const uint64_t value,
const size_t mboard = 0) = 0;
1475 virtual uint64_t read_register(
const std::string &path,
const uint32_t field,
const size_t mboard = 0) = 0;
1491 virtual std::vector<std::string> get_filter_names(
const std::string &search_mask =
"") = 0;
gain_range_t get_rx_gain_range(size_t chan=0)
A convenience wrapper for getting overall RX gain range.
Definition: multi_usrp.hpp:929
Definition: stream_cmd.hpp:36
Definition: tune_result.hpp:19
double get_tx_gain(size_t chan=0)
A convenience wrapper for getting overall TX gain.
Definition: multi_usrp.hpp:1207
void set_tx_gain(double gain, size_t chan=0)
A convenience wrapper for setting overall TX gain.
Definition: multi_usrp.hpp:1181
Definition: time_spec.hpp:29
bool readable
Definition: multi_usrp.hpp:1440
boost::shared_ptr< device > sptr
Definition: device.hpp:31
boost::shared_ptr< multi_usrp > sptr
Definition: multi_usrp.hpp:96
Definition: multi_usrp.hpp:1438
double get_rx_gain(size_t chan=0)
A convenience wrapper for getting overall RX gain.
Definition: multi_usrp.hpp:903
Definition: tune_request.hpp:25
boost::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:172
static const std::string ALL_GAINS
A wildcard gain element name.
Definition: multi_usrp.hpp:107
Definition: build_info.hpp:14
Definition: sensors.hpp:29
boost::shared_ptr< filter_info_base > sptr
Definition: filters.hpp:28
Definition: clock_config.hpp:26
Definition: multi_usrp.hpp:94
Definition: stream.hpp:58
#define UHD_API
Definition: config.h:63
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:87
boost::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:54
void set_rx_gain(double gain, size_t chan=0)
A convenience wrapper for setting overall RX gain.
Definition: multi_usrp.hpp:861
static const std::string ALL_LOS
A wildcard LO stage name.
Definition: multi_usrp.hpp:110
Definition: subdev_spec.hpp:62
bool writable
Definition: multi_usrp.hpp:1441
size_t bitwidth
Definition: multi_usrp.hpp:1439
boost::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:248
gain_range_t get_tx_gain_range(size_t chan=0)
A convenience wrapper for getting overall TX gain range.
Definition: multi_usrp.hpp:1233
Definition: device_addr.hpp:38