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_COMMAND_TIME_API 26 #define UHD_USRP_MULTI_USRP_BW_RANGE_API 27 #define UHD_USRP_MULTI_USRP_USER_REGS_API 28 #define UHD_USRP_MULTI_USRP_GET_USRP_INFO_API 40 #include <boost/shared_ptr.hpp> 41 #include <boost/utility.hpp> 46 namespace uhd{
namespace usrp{
96 typedef boost::shared_ptr<multi_usrp>
sptr;
99 static const size_t ALL_MBOARDS = size_t(~0);
102 static const size_t ALL_CHANS = size_t(~0);
123 return this->get_device()->get_rx_stream(args);
128 return this->get_device()->get_tx_stream(args);
163 virtual void set_master_clock_rate(
double rate,
size_t mboard = ALL_MBOARDS) = 0;
170 virtual double get_master_clock_rate(
size_t mboard = 0) = 0;
176 virtual std::string get_pp_string(
void) = 0;
183 virtual std::string get_mboard_name(
size_t mboard = 0) = 0;
190 virtual time_spec_t get_time_now(
size_t mboard = 0) = 0;
197 virtual time_spec_t get_time_last_pps(
size_t mboard = 0) = 0;
210 virtual void set_time_now(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
224 virtual void set_time_next_pps(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
241 virtual void set_time_unknown_pps(
const time_spec_t &time_spec) = 0;
249 virtual bool get_time_synchronized(
void) = 0;
261 virtual void set_command_time(
const uhd::time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
268 virtual void clear_command_time(
size_t mboard = ALL_MBOARDS) = 0;
282 virtual void issue_stream_cmd(
const stream_cmd_t &stream_cmd,
size_t chan = ALL_CHANS) = 0;
292 virtual void set_clock_config(
const clock_config_t &clock_config,
size_t mboard = ALL_MBOARDS) = 0;
302 virtual void set_time_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
309 virtual std::string get_time_source(
const size_t mboard) = 0;
316 virtual std::vector<std::string> get_time_sources(
const size_t mboard) = 0;
325 virtual void set_clock_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
332 virtual std::string get_clock_source(
const size_t mboard) = 0;
339 virtual std::vector<std::string> get_clock_sources(
const size_t mboard) = 0;
344 virtual size_t get_num_mboards(
void) = 0;
352 virtual sensor_value_t get_mboard_sensor(
const std::string &name,
size_t mboard = 0) = 0;
359 virtual std::vector<std::string> get_mboard_sensor_names(
size_t mboard = 0) = 0;
368 virtual void set_user_register(
const boost::uint8_t addr,
const boost::uint32_t data,
size_t mboard = ALL_MBOARDS) = 0;
395 virtual size_t get_rx_num_channels(
void) = 0;
402 virtual std::string get_rx_subdev_name(
size_t chan = 0) = 0;
409 virtual void set_rx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
416 virtual double get_rx_rate(
size_t chan = 0) = 0;
440 virtual double get_rx_freq(
size_t chan = 0) = 0;
451 virtual freq_range_t get_rx_freq_range(
size_t chan = 0) = 0;
458 virtual freq_range_t get_fe_rx_freq_range(
size_t chan = 0) = 0;
467 virtual void set_rx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
471 return this->set_rx_gain(gain, ALL_GAINS, chan);
481 virtual double get_rx_gain(
const std::string &name,
size_t chan = 0) = 0;
485 return this->get_rx_gain(ALL_GAINS, chan);
495 virtual gain_range_t get_rx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
499 return this->get_rx_gain_range(ALL_GAINS, chan);
508 virtual std::vector<std::string> get_rx_gain_names(
size_t chan = 0) = 0;
515 virtual void set_rx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
522 virtual std::string get_rx_antenna(
size_t chan = 0) = 0;
529 virtual std::vector<std::string> get_rx_antennas(
size_t chan = 0) = 0;
537 return this->get_rx_sensor(
"lo_locked", chan).to_bool();
545 virtual void set_rx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
552 virtual double get_rx_bandwidth(
size_t chan = 0) = 0;
559 virtual meta_range_t get_rx_bandwidth_range(
size_t chan = 0) = 0;
568 return this->get_rx_sensor(
"rssi", chan).to_real();
586 virtual sensor_value_t get_rx_sensor(
const std::string &name,
size_t chan = 0) = 0;
593 virtual std::vector<std::string> get_rx_sensor_names(
size_t chan = 0) = 0;
607 virtual void set_rx_dc_offset(
const bool enb,
size_t chan = ALL_CHANS) = 0;
616 virtual void set_rx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
625 virtual void set_rx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 0;
652 virtual size_t get_tx_num_channels(
void) = 0;
659 virtual std::string get_tx_subdev_name(
size_t chan = 0) = 0;
666 virtual void set_tx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
673 virtual double get_tx_rate(
size_t chan = 0) = 0;
697 virtual double get_tx_freq(
size_t chan = 0) = 0;
708 virtual freq_range_t get_tx_freq_range(
size_t chan = 0) = 0;
715 virtual freq_range_t get_fe_tx_freq_range(
size_t chan = 0) = 0;
724 virtual void set_tx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
728 return this->set_tx_gain(gain, ALL_GAINS, chan);
738 virtual double get_tx_gain(
const std::string &name,
size_t chan = 0) = 0;
742 return this->get_tx_gain(ALL_GAINS, chan);
752 virtual gain_range_t get_tx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
756 return this->get_tx_gain_range(ALL_GAINS, chan);
765 virtual std::vector<std::string> get_tx_gain_names(
size_t chan = 0) = 0;
772 virtual void set_tx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
779 virtual std::string get_tx_antenna(
size_t chan = 0) = 0;
786 virtual std::vector<std::string> get_tx_antennas(
size_t chan = 0) = 0;
794 return this->get_tx_sensor(
"lo_locked", chan).to_bool();
802 virtual void set_tx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
809 virtual double get_tx_bandwidth(
size_t chan = 0) = 0;
816 virtual meta_range_t get_tx_bandwidth_range(
size_t chan = 0) = 0;
833 virtual sensor_value_t get_tx_sensor(
const std::string &name,
size_t chan = 0) = 0;
840 virtual std::vector<std::string> get_tx_sensor_names(
size_t chan = 0) = 0;
848 virtual void set_tx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
857 virtual void set_tx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 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:498
Definition: stream_cmd.hpp:46
UHD_DEPRECATED bool get_tx_lo_locked(size_t chan=0)
Definition: multi_usrp.hpp:793
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:741
#define UHD_DEPRECATED
Definition: config.hpp:68
void set_tx_gain(double gain, size_t chan=0)
A convenience wrapper for setting overall TX gain.
Definition: multi_usrp.hpp:727
Definition: time_spec.hpp:39
boost::shared_ptr< device > sptr
Definition: device.hpp:40
boost::shared_ptr< multi_usrp > sptr
Definition: multi_usrp.hpp:96
double get_rx_gain(size_t chan=0)
A convenience wrapper for getting overall RX gain.
Definition: multi_usrp.hpp:484
Definition: tune_request.hpp:32
boost::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:125
static const std::string ALL_GAINS
A wildcard gain element name.
Definition: multi_usrp.hpp:105
#define UHD_API
Definition: config.hpp:76
Definition: convert.hpp:28
Definition: sensors.hpp:38
Definition: clock_config.hpp:36
Definition: multi_usrp.hpp:94
rx_streamer::sptr get_rx_stream(const stream_args_t &args)
Convenience method to get a RX streamer.
Definition: multi_usrp.hpp:122
Definition: stream.hpp:39
UHD_DEPRECATED bool get_rx_lo_locked(size_t chan=0)
Definition: multi_usrp.hpp:536
boost::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:60
void set_rx_gain(double gain, size_t chan=0)
A convenience wrapper for setting overall RX gain.
Definition: multi_usrp.hpp:470
Definition: subdev_spec.hpp:66
UHD_DEPRECATED double read_rssi(size_t chan=0)
Definition: multi_usrp.hpp:567
boost::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:182
tx_streamer::sptr get_tx_stream(const stream_args_t &args)
Convenience method to get a TX streamer.
Definition: multi_usrp.hpp:127
gain_range_t get_tx_gain_range(size_t chan=0)
A convenience wrapper for getting overall TX gain range.
Definition: multi_usrp.hpp:755
Definition: device_addr.hpp:47