18 #ifndef INCLUDED_UHD_USRP_MULTI_USRP_HPP 19 #define INCLUDED_UHD_USRP_MULTI_USRP_HPP 22 #define UHD_USRP_MULTI_USRP_REF_SOURCES_API 23 #define UHD_USRP_MULTI_USRP_GET_RATES_API 24 #define UHD_USRP_MULTI_USRP_FRONTEND_CAL_API 25 #define UHD_USRP_MULTI_USRP_FRONTEND_IQ_AUTO_API 26 #define UHD_USRP_MULTI_USRP_COMMAND_TIME_API 27 #define UHD_USRP_MULTI_USRP_BW_RANGE_API 28 #define UHD_USRP_MULTI_USRP_USER_REGS_API 29 #define UHD_USRP_MULTI_USRP_GET_USRP_INFO_API 30 #define UHD_USRP_MULTI_USRP_NORMALIZED_GAIN 31 #define UHD_USRP_MULTI_USRP_GPIO_API 32 #define UHD_USRP_MULTI_USRP_REGISTER_API 33 #define UHD_USRP_MULTI_USRP_FILTER_API 34 #define UHD_USRP_MULTI_USRP_LO_CONFIG_API 48 #include <boost/shared_ptr.hpp> 49 #include <boost/utility.hpp> 54 namespace uhd{
namespace usrp{
104 typedef boost::shared_ptr<multi_usrp>
sptr;
109 static const size_t ALL_MBOARDS = size_t(~0);
112 static const size_t ALL_CHANS = size_t(~0);
136 virtual bool is_device3(
void) = 0;
191 virtual void set_master_clock_rate(
double rate,
size_t mboard = ALL_MBOARDS) = 0;
198 virtual double get_master_clock_rate(
size_t mboard = 0) = 0;
204 virtual std::string get_pp_string(
void) = 0;
211 virtual std::string get_mboard_name(
size_t mboard = 0) = 0;
218 virtual time_spec_t get_time_now(
size_t mboard = 0) = 0;
225 virtual time_spec_t get_time_last_pps(
size_t mboard = 0) = 0;
238 virtual void set_time_now(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
252 virtual void set_time_next_pps(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
269 virtual void set_time_unknown_pps(
const time_spec_t &time_spec) = 0;
277 virtual bool get_time_synchronized(
void) = 0;
289 virtual void set_command_time(
const uhd::time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
296 virtual void clear_command_time(
size_t mboard = ALL_MBOARDS) = 0;
310 virtual void issue_stream_cmd(
const stream_cmd_t &stream_cmd,
size_t chan = ALL_CHANS) = 0;
320 virtual void set_clock_config(
const clock_config_t &clock_config,
size_t mboard = ALL_MBOARDS) = 0;
330 virtual void set_time_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
337 virtual std::string get_time_source(
const size_t mboard) = 0;
344 virtual std::vector<std::string> get_time_sources(
const size_t mboard) = 0;
353 virtual void set_clock_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
360 virtual std::string get_clock_source(
const size_t mboard) = 0;
367 virtual std::vector<std::string> get_clock_sources(
const size_t mboard) = 0;
377 virtual void set_clock_source_out(
const bool enb,
const size_t mboard = ALL_MBOARDS) = 0;
387 virtual void set_time_source_out(
const bool enb,
const size_t mboard = ALL_MBOARDS) = 0;
392 virtual size_t get_num_mboards(
void) = 0;
400 virtual sensor_value_t get_mboard_sensor(
const std::string &name,
size_t mboard = 0) = 0;
407 virtual std::vector<std::string> get_mboard_sensor_names(
size_t mboard = 0) = 0;
416 virtual void set_user_register(
const boost::uint8_t addr,
const boost::uint32_t data,
size_t mboard = ALL_MBOARDS) = 0;
443 virtual size_t get_rx_num_channels(
void) = 0;
450 virtual std::string get_rx_subdev_name(
size_t chan = 0) = 0;
457 virtual void set_rx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
464 virtual double get_rx_rate(
size_t chan = 0) = 0;
488 virtual double get_rx_freq(
size_t chan = 0) = 0;
499 virtual freq_range_t get_rx_freq_range(
size_t chan = 0) = 0;
506 virtual freq_range_t get_fe_rx_freq_range(
size_t chan = 0) = 0;
513 virtual std::vector<std::string> get_rx_lo_names(
size_t chan = 0) = 0;
524 virtual void set_rx_lo_source(
const std::string &src,
const std::string &name = ALL_LOS,
size_t chan = 0) = 0;
534 virtual const std::string get_rx_lo_source(
const std::string &name = ALL_LOS,
size_t chan = 0) = 0;
544 virtual std::vector<std::string> get_rx_lo_sources(
const std::string &name = ALL_LOS,
size_t chan = 0) = 0;
554 virtual void set_rx_lo_export_enabled(
bool enabled,
const std::string &name = ALL_LOS,
size_t chan = 0) = 0;
561 virtual bool get_rx_lo_export_enabled(
const std::string &name = ALL_LOS,
size_t chan = 0) = 0;
570 virtual double set_rx_lo_freq(
double freq,
const std::string &name,
size_t chan = 0) = 0;
580 virtual double get_rx_lo_freq(
const std::string &name,
size_t chan = 0) = 0;
590 virtual freq_range_t get_rx_lo_freq_range(
const std::string &name,
size_t chan = 0) = 0;
599 virtual void set_rx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
603 return this->set_rx_gain(gain, ALL_GAINS, chan);
622 virtual void set_normalized_rx_gain(
double gain,
size_t chan = 0) = 0;
632 virtual void set_rx_agc(
bool enable,
size_t chan = 0) = 0;
641 virtual double get_rx_gain(
const std::string &name,
size_t chan = 0) = 0;
645 return this->get_rx_gain(ALL_GAINS, chan);
658 virtual double get_normalized_rx_gain(
size_t chan = 0) = 0;
667 virtual gain_range_t get_rx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
671 return this->get_rx_gain_range(ALL_GAINS, chan);
680 virtual std::vector<std::string> get_rx_gain_names(
size_t chan = 0) = 0;
687 virtual void set_rx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
694 virtual std::string get_rx_antenna(
size_t chan = 0) = 0;
701 virtual std::vector<std::string> get_rx_antennas(
size_t chan = 0) = 0;
708 virtual void set_rx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
715 virtual double get_rx_bandwidth(
size_t chan = 0) = 0;
722 virtual meta_range_t get_rx_bandwidth_range(
size_t chan = 0) = 0;
739 virtual sensor_value_t get_rx_sensor(
const std::string &name,
size_t chan = 0) = 0;
746 virtual std::vector<std::string> get_rx_sensor_names(
size_t chan = 0) = 0;
760 virtual void set_rx_dc_offset(
const bool enb,
size_t chan = ALL_CHANS) = 0;
769 virtual void set_rx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
777 virtual void set_rx_iq_balance(
const bool enb,
size_t chan) = 0;
786 virtual void set_rx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 0;
813 virtual size_t get_tx_num_channels(
void) = 0;
820 virtual std::string get_tx_subdev_name(
size_t chan = 0) = 0;
827 virtual void set_tx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
834 virtual double get_tx_rate(
size_t chan = 0) = 0;
858 virtual double get_tx_freq(
size_t chan = 0) = 0;
869 virtual freq_range_t get_tx_freq_range(
size_t chan = 0) = 0;
876 virtual freq_range_t get_fe_tx_freq_range(
size_t chan = 0) = 0;
885 virtual void set_tx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
889 return this->set_tx_gain(gain, ALL_GAINS, chan);
902 virtual void set_normalized_tx_gain(
double gain,
size_t chan = 0) = 0;
911 virtual double get_tx_gain(
const std::string &name,
size_t chan = 0) = 0;
915 return this->get_tx_gain(ALL_GAINS, chan);
928 virtual double get_normalized_tx_gain(
size_t chan = 0) = 0;
937 virtual gain_range_t get_tx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
941 return this->get_tx_gain_range(ALL_GAINS, chan);
950 virtual std::vector<std::string> get_tx_gain_names(
size_t chan = 0) = 0;
957 virtual void set_tx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
964 virtual std::string get_tx_antenna(
size_t chan = 0) = 0;
971 virtual std::vector<std::string> get_tx_antennas(
size_t chan = 0) = 0;
978 virtual void set_tx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
985 virtual double get_tx_bandwidth(
size_t chan = 0) = 0;
992 virtual meta_range_t get_tx_bandwidth_range(
size_t chan = 0) = 0;
1009 virtual sensor_value_t get_tx_sensor(
const std::string &name,
size_t chan = 0) = 0;
1016 virtual std::vector<std::string> get_tx_sensor_names(
size_t chan = 0) = 0;
1024 virtual void set_tx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
1033 virtual void set_tx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 0;
1044 virtual std::vector<std::string> get_gpio_banks(
const size_t mboard) = 0;
1062 virtual void set_gpio_attr(
const std::string &bank,
const std::string &attr,
const boost::uint32_t value,
const boost::uint32_t
mask = 0xffffffff,
const size_t mboard = 0) = 0;
1080 virtual boost::uint32_t get_gpio_attr(
const std::string &bank,
const std::string &attr,
const size_t mboard = 0) = 0;
1096 virtual std::vector<std::string> enumerate_registers(
const size_t mboard = 0) = 0;
1104 virtual register_info_t get_register_info(
const std::string &path,
const size_t mboard = 0) = 0;
1113 virtual void write_register(
const std::string &path,
const boost::uint32_t field,
const boost::uint64_t value,
const size_t mboard = 0) = 0;
1122 virtual boost::uint64_t read_register(
const std::string &path,
const boost::uint32_t field,
const size_t mboard = 0) = 0;
1138 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:670
Definition: stream_cmd.hpp:46
Definition: tune_result.hpp:29
double get_tx_gain(size_t chan=0)
A convenience wrapper for getting overall TX gain.
Definition: multi_usrp.hpp:914
void set_tx_gain(double gain, size_t chan=0)
A convenience wrapper for setting overall TX gain.
Definition: multi_usrp.hpp:888
Definition: time_spec.hpp:39
bool readable
Definition: multi_usrp.hpp:1087
boost::shared_ptr< device > sptr
Definition: device.hpp:41
boost::shared_ptr< multi_usrp > sptr
Definition: multi_usrp.hpp:104
Definition: multi_usrp.hpp:1085
double get_rx_gain(size_t chan=0)
A convenience wrapper for getting overall RX gain.
Definition: multi_usrp.hpp:644
Definition: tune_request.hpp:33
boost::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:184
static const std::string ALL_GAINS
A wildcard gain element name.
Definition: multi_usrp.hpp:115
Definition: build_info.hpp:25
Definition: sensors.hpp:38
boost::shared_ptr< filter_info_base > sptr
Definition: filters.hpp:38
Definition: clock_config.hpp:36
Definition: multi_usrp.hpp:102
Definition: stream.hpp:57
#define UHD_API
Definition: config.h:73
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:98
boost::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:64
void set_rx_gain(double gain, size_t chan=0)
A convenience wrapper for setting overall RX gain.
Definition: multi_usrp.hpp:602
static const std::string ALL_LOS
A wildcard gain element name.
Definition: multi_usrp.hpp:118
Definition: subdev_spec.hpp:66
bool writable
Definition: multi_usrp.hpp:1088
size_t bitwidth
Definition: multi_usrp.hpp:1086
boost::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:256
boost::shared_ptr< device3 > sptr
Definition: device3.hpp:39
gain_range_t get_tx_gain_range(size_t chan=0)
A convenience wrapper for getting overall TX gain range.
Definition: multi_usrp.hpp:940
Definition: device_addr.hpp:47