7 #ifndef INCLUDED_UHD_USRP_MULTI_USRP_HPP 8 #define INCLUDED_UHD_USRP_MULTI_USRP_HPP 11 #define UHD_USRP_MULTI_USRP_REF_SOURCES_API 12 #define UHD_USRP_MULTI_USRP_GET_RATES_API 13 #define UHD_USRP_MULTI_USRP_FRONTEND_CAL_API 14 #define UHD_USRP_MULTI_USRP_FRONTEND_IQ_AUTO_API 15 #define UHD_USRP_MULTI_USRP_COMMAND_TIME_API 16 #define UHD_USRP_MULTI_USRP_BW_RANGE_API 17 #define UHD_USRP_MULTI_USRP_USER_REGS_API 18 #define UHD_USRP_MULTI_USRP_GET_USRP_INFO_API 19 #define UHD_USRP_MULTI_USRP_NORMALIZED_GAIN 20 #define UHD_USRP_MULTI_USRP_GPIO_API 21 #define UHD_USRP_MULTI_USRP_REGISTER_API 22 #define UHD_USRP_MULTI_USRP_FILTER_API 23 #define UHD_USRP_MULTI_USRP_LO_CONFIG_API 36 #include <boost/shared_ptr.hpp> 37 #include <boost/utility.hpp> 42 namespace uhd{
namespace usrp{
92 typedef boost::shared_ptr<multi_usrp>
sptr;
97 static const size_t ALL_MBOARDS = size_t(~0);
100 static const size_t ALL_CHANS = size_t(~0);
174 virtual void set_master_clock_rate(
double rate,
size_t mboard = ALL_MBOARDS) = 0;
181 virtual double get_master_clock_rate(
size_t mboard = 0) = 0;
187 virtual std::string get_pp_string(
void) = 0;
194 virtual std::string get_mboard_name(
size_t mboard = 0) = 0;
201 virtual time_spec_t get_time_now(
size_t mboard = 0) = 0;
208 virtual time_spec_t get_time_last_pps(
size_t mboard = 0) = 0;
221 virtual void set_time_now(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
235 virtual void set_time_next_pps(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
252 virtual void set_time_unknown_pps(
const time_spec_t &time_spec) = 0;
260 virtual bool get_time_synchronized(
void) = 0;
272 virtual void set_command_time(
const uhd::time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
279 virtual void clear_command_time(
size_t mboard = ALL_MBOARDS) = 0;
293 virtual void issue_stream_cmd(
const stream_cmd_t &stream_cmd,
size_t chan = ALL_CHANS) = 0;
303 virtual void set_clock_config(
const clock_config_t &clock_config,
size_t mboard = ALL_MBOARDS) = 0;
313 virtual void set_time_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
320 virtual std::string get_time_source(
const size_t mboard) = 0;
327 virtual std::vector<std::string> get_time_sources(
const size_t mboard) = 0;
336 virtual void set_clock_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
343 virtual std::string get_clock_source(
const size_t mboard) = 0;
350 virtual std::vector<std::string> get_clock_sources(
const size_t mboard) = 0;
360 virtual void set_clock_source_out(
const bool enb,
const size_t mboard = ALL_MBOARDS) = 0;
370 virtual void set_time_source_out(
const bool enb,
const size_t mboard = ALL_MBOARDS) = 0;
375 virtual size_t get_num_mboards(
void) = 0;
383 virtual sensor_value_t get_mboard_sensor(
const std::string &name,
size_t mboard = 0) = 0;
390 virtual std::vector<std::string> get_mboard_sensor_names(
size_t mboard = 0) = 0;
399 virtual void set_user_register(
const uint8_t addr,
const uint32_t data,
size_t mboard = ALL_MBOARDS) = 0;
426 virtual size_t get_rx_num_channels(
void) = 0;
433 virtual std::string get_rx_subdev_name(
size_t chan = 0) = 0;
440 virtual void set_rx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
447 virtual double get_rx_rate(
size_t chan = 0) = 0;
471 virtual double get_rx_freq(
size_t chan = 0) = 0;
482 virtual freq_range_t get_rx_freq_range(
size_t chan = 0) = 0;
489 virtual freq_range_t get_fe_rx_freq_range(
size_t chan = 0) = 0;
507 virtual std::vector<std::string> get_rx_lo_names(
size_t chan = 0) = 0;
520 virtual void set_rx_lo_source(
521 const std::string &src,
522 const std::string &name = ALL_LOS,
534 virtual const std::string get_rx_lo_source(
535 const std::string &name = ALL_LOS,
550 virtual std::vector<std::string> get_rx_lo_sources(
551 const std::string &name = ALL_LOS,
565 virtual void set_rx_lo_export_enabled(
567 const std::string &name = ALL_LOS,
576 virtual bool get_rx_lo_export_enabled(
577 const std::string &name = ALL_LOS,
604 virtual double set_rx_lo_freq(
606 const std::string &name,
620 virtual double get_rx_lo_freq(
621 const std::string &name,
635 const std::string &name,
651 virtual std::vector<std::string> get_tx_lo_names(
size_t chan = 0) = 0;
664 virtual void set_tx_lo_source(
665 const std::string &src,
666 const std::string &name = ALL_LOS,
667 const size_t chan = 0
678 virtual const std::string get_tx_lo_source(
679 const std::string &name = ALL_LOS,
680 const size_t chan = 0
693 virtual std::vector<std::string> get_tx_lo_sources(
694 const std::string &name = ALL_LOS,
695 const size_t chan = 0
708 virtual void set_tx_lo_export_enabled(
710 const std::string &name = ALL_LOS,
711 const size_t chan = 0
719 virtual bool get_tx_lo_export_enabled(
720 const std::string &name = ALL_LOS,
721 const size_t chan = 0
747 virtual double set_tx_lo_freq(
749 const std::string &name,
763 virtual double get_tx_lo_freq(
764 const std::string &name,
778 const std::string &name,
792 virtual void set_rx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
806 virtual std::vector<std::string> get_rx_gain_profile_names(
const size_t chan = 0) = 0;
813 virtual void set_rx_gain_profile(
const std::string& profile,
const size_t chan = 0) = 0;
820 virtual std::string get_rx_gain_profile(
const size_t chan = 0) = 0;
824 return this->set_rx_gain(gain, ALL_GAINS, chan);
843 virtual void set_normalized_rx_gain(
double gain,
size_t chan = 0) = 0;
853 virtual void set_rx_agc(
bool enable,
size_t chan = 0) = 0;
862 virtual double get_rx_gain(
const std::string &name,
size_t chan = 0) = 0;
866 return this->get_rx_gain(ALL_GAINS, chan);
879 virtual double get_normalized_rx_gain(
size_t chan = 0) = 0;
888 virtual gain_range_t get_rx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
892 return this->get_rx_gain_range(ALL_GAINS, chan);
901 virtual std::vector<std::string> get_rx_gain_names(
size_t chan = 0) = 0;
908 virtual void set_rx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
915 virtual std::string get_rx_antenna(
size_t chan = 0) = 0;
922 virtual std::vector<std::string> get_rx_antennas(
size_t chan = 0) = 0;
929 virtual void set_rx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
936 virtual double get_rx_bandwidth(
size_t chan = 0) = 0;
943 virtual meta_range_t get_rx_bandwidth_range(
size_t chan = 0) = 0;
960 virtual sensor_value_t get_rx_sensor(
const std::string &name,
size_t chan = 0) = 0;
967 virtual std::vector<std::string> get_rx_sensor_names(
size_t chan = 0) = 0;
981 virtual void set_rx_dc_offset(
const bool enb,
size_t chan = ALL_CHANS) = 0;
990 virtual void set_rx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
998 virtual void set_rx_iq_balance(
const bool enb,
size_t chan) = 0;
1007 virtual void set_rx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 0;
1034 virtual size_t get_tx_num_channels(
void) = 0;
1041 virtual std::string get_tx_subdev_name(
size_t chan = 0) = 0;
1048 virtual void set_tx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
1055 virtual double get_tx_rate(
size_t chan = 0) = 0;
1062 virtual meta_range_t get_tx_rates(
size_t chan = 0) = 0;
1079 virtual double get_tx_freq(
size_t chan = 0) = 0;
1090 virtual freq_range_t get_tx_freq_range(
size_t chan = 0) = 0;
1097 virtual freq_range_t get_fe_tx_freq_range(
size_t chan = 0) = 0;
1106 virtual void set_tx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
1120 virtual std::vector<std::string> get_tx_gain_profile_names(
const size_t chan = 0) = 0;
1127 virtual void set_tx_gain_profile(
const std::string& profile,
const size_t chan = 0) = 0;
1134 virtual std::string get_tx_gain_profile(
const size_t chan = 0) = 0;
1138 return this->set_tx_gain(gain, ALL_GAINS, chan);
1151 virtual void set_normalized_tx_gain(
double gain,
size_t chan = 0) = 0;
1160 virtual double get_tx_gain(
const std::string &name,
size_t chan = 0) = 0;
1164 return this->get_tx_gain(ALL_GAINS, chan);
1177 virtual double get_normalized_tx_gain(
size_t chan = 0) = 0;
1186 virtual gain_range_t get_tx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
1190 return this->get_tx_gain_range(ALL_GAINS, chan);
1199 virtual std::vector<std::string> get_tx_gain_names(
size_t chan = 0) = 0;
1206 virtual void set_tx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
1213 virtual std::string get_tx_antenna(
size_t chan = 0) = 0;
1220 virtual std::vector<std::string> get_tx_antennas(
size_t chan = 0) = 0;
1227 virtual void set_tx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
1234 virtual double get_tx_bandwidth(
size_t chan = 0) = 0;
1241 virtual meta_range_t get_tx_bandwidth_range(
size_t chan = 0) = 0;
1258 virtual sensor_value_t get_tx_sensor(
const std::string &name,
size_t chan = 0) = 0;
1265 virtual std::vector<std::string> get_tx_sensor_names(
size_t chan = 0) = 0;
1273 virtual void set_tx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
1282 virtual void set_tx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 0;
1293 virtual std::vector<std::string> get_gpio_banks(
const size_t mboard) = 0;
1311 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;
1329 virtual uint32_t get_gpio_attr(
const std::string &bank,
const std::string &attr,
const size_t mboard = 0) = 0;
1345 virtual std::vector<std::string> enumerate_registers(
const size_t mboard = 0) = 0;
1353 virtual register_info_t get_register_info(
const std::string &path,
const size_t mboard = 0) = 0;
1362 virtual void write_register(
const std::string &path,
const uint32_t field,
const uint64_t value,
const size_t mboard = 0) = 0;
1371 virtual uint64_t read_register(
const std::string &path,
const uint32_t field,
const size_t mboard = 0) = 0;
1387 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:891
Definition: stream_cmd.hpp:35
Definition: tune_result.hpp:18
double get_tx_gain(size_t chan=0)
A convenience wrapper for getting overall TX gain.
Definition: multi_usrp.hpp:1163
void set_tx_gain(double gain, size_t chan=0)
A convenience wrapper for setting overall TX gain.
Definition: multi_usrp.hpp:1137
Definition: time_spec.hpp:28
bool readable
Definition: multi_usrp.hpp:1336
boost::shared_ptr< device > sptr
Definition: device.hpp:30
boost::shared_ptr< multi_usrp > sptr
Definition: multi_usrp.hpp:92
Definition: multi_usrp.hpp:1334
double get_rx_gain(size_t chan=0)
A convenience wrapper for getting overall RX gain.
Definition: multi_usrp.hpp:865
Definition: tune_request.hpp:22
boost::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:160
static const std::string ALL_GAINS
A wildcard gain element name.
Definition: multi_usrp.hpp:103
Definition: build_info.hpp:14
Definition: sensors.hpp:28
boost::shared_ptr< filter_info_base > sptr
Definition: filters.hpp:27
Definition: clock_config.hpp:25
Definition: multi_usrp.hpp:90
Definition: stream.hpp:46
#define UHD_API
Definition: config.h:62
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:86
boost::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:53
void set_rx_gain(double gain, size_t chan=0)
A convenience wrapper for setting overall RX gain.
Definition: multi_usrp.hpp:823
static const std::string ALL_LOS
A wildcard LO stage name.
Definition: multi_usrp.hpp:106
Definition: subdev_spec.hpp:61
bool writable
Definition: multi_usrp.hpp:1337
size_t bitwidth
Definition: multi_usrp.hpp:1335
boost::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:236
gain_range_t get_tx_gain_range(size_t chan=0)
A convenience wrapper for getting overall TX gain range.
Definition: multi_usrp.hpp:1189
Definition: device_addr.hpp:36