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);
159 virtual void set_master_clock_rate(
double rate,
size_t mboard = ALL_MBOARDS) = 0;
166 virtual double get_master_clock_rate(
size_t mboard = 0) = 0;
172 virtual std::string get_pp_string(
void) = 0;
179 virtual std::string get_mboard_name(
size_t mboard = 0) = 0;
186 virtual time_spec_t get_time_now(
size_t mboard = 0) = 0;
193 virtual time_spec_t get_time_last_pps(
size_t mboard = 0) = 0;
206 virtual void set_time_now(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
220 virtual void set_time_next_pps(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
237 virtual void set_time_unknown_pps(
const time_spec_t &time_spec) = 0;
245 virtual bool get_time_synchronized(
void) = 0;
257 virtual void set_command_time(
const uhd::time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
264 virtual void clear_command_time(
size_t mboard = ALL_MBOARDS) = 0;
278 virtual void issue_stream_cmd(
const stream_cmd_t &stream_cmd,
size_t chan = ALL_CHANS) = 0;
288 virtual void set_clock_config(
const clock_config_t &clock_config,
size_t mboard = ALL_MBOARDS) = 0;
298 virtual void set_time_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
305 virtual std::string get_time_source(
const size_t mboard) = 0;
312 virtual std::vector<std::string> get_time_sources(
const size_t mboard) = 0;
321 virtual void set_clock_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
328 virtual std::string get_clock_source(
const size_t mboard) = 0;
335 virtual std::vector<std::string> get_clock_sources(
const size_t mboard) = 0;
345 virtual void set_clock_source_out(
const bool enb,
const size_t mboard = ALL_MBOARDS) = 0;
355 virtual void set_time_source_out(
const bool enb,
const size_t mboard = ALL_MBOARDS) = 0;
360 virtual size_t get_num_mboards(
void) = 0;
368 virtual sensor_value_t get_mboard_sensor(
const std::string &name,
size_t mboard = 0) = 0;
375 virtual std::vector<std::string> get_mboard_sensor_names(
size_t mboard = 0) = 0;
384 virtual void set_user_register(
const boost::uint8_t addr,
const boost::uint32_t data,
size_t mboard = ALL_MBOARDS) = 0;
411 virtual size_t get_rx_num_channels(
void) = 0;
418 virtual std::string get_rx_subdev_name(
size_t chan = 0) = 0;
425 virtual void set_rx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
432 virtual double get_rx_rate(
size_t chan = 0) = 0;
456 virtual double get_rx_freq(
size_t chan = 0) = 0;
467 virtual freq_range_t get_rx_freq_range(
size_t chan = 0) = 0;
474 virtual freq_range_t get_fe_rx_freq_range(
size_t chan = 0) = 0;
483 virtual void set_rx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
487 return this->set_rx_gain(gain, ALL_GAINS, chan);
497 virtual double get_rx_gain(
const std::string &name,
size_t chan = 0) = 0;
501 return this->get_rx_gain(ALL_GAINS, chan);
511 virtual gain_range_t get_rx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
515 return this->get_rx_gain_range(ALL_GAINS, chan);
524 virtual std::vector<std::string> get_rx_gain_names(
size_t chan = 0) = 0;
531 virtual void set_rx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
538 virtual std::string get_rx_antenna(
size_t chan = 0) = 0;
545 virtual std::vector<std::string> get_rx_antennas(
size_t chan = 0) = 0;
553 return this->get_rx_sensor(
"lo_locked", chan).to_bool();
561 virtual void set_rx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
568 virtual double get_rx_bandwidth(
size_t chan = 0) = 0;
575 virtual meta_range_t get_rx_bandwidth_range(
size_t chan = 0) = 0;
584 return this->get_rx_sensor(
"rssi", chan).to_real();
602 virtual sensor_value_t get_rx_sensor(
const std::string &name,
size_t chan = 0) = 0;
609 virtual std::vector<std::string> get_rx_sensor_names(
size_t chan = 0) = 0;
623 virtual void set_rx_dc_offset(
const bool enb,
size_t chan = ALL_CHANS) = 0;
632 virtual void set_rx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
641 virtual void set_rx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 0;
668 virtual size_t get_tx_num_channels(
void) = 0;
675 virtual std::string get_tx_subdev_name(
size_t chan = 0) = 0;
682 virtual void set_tx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
689 virtual double get_tx_rate(
size_t chan = 0) = 0;
713 virtual double get_tx_freq(
size_t chan = 0) = 0;
724 virtual freq_range_t get_tx_freq_range(
size_t chan = 0) = 0;
731 virtual freq_range_t get_fe_tx_freq_range(
size_t chan = 0) = 0;
740 virtual void set_tx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
744 return this->set_tx_gain(gain, ALL_GAINS, chan);
754 virtual double get_tx_gain(
const std::string &name,
size_t chan = 0) = 0;
758 return this->get_tx_gain(ALL_GAINS, chan);
768 virtual gain_range_t get_tx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
772 return this->get_tx_gain_range(ALL_GAINS, chan);
781 virtual std::vector<std::string> get_tx_gain_names(
size_t chan = 0) = 0;
788 virtual void set_tx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
795 virtual std::string get_tx_antenna(
size_t chan = 0) = 0;
802 virtual std::vector<std::string> get_tx_antennas(
size_t chan = 0) = 0;
810 return this->get_tx_sensor(
"lo_locked", chan).to_bool();
818 virtual void set_tx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
825 virtual double get_tx_bandwidth(
size_t chan = 0) = 0;
832 virtual meta_range_t get_tx_bandwidth_range(
size_t chan = 0) = 0;
849 virtual sensor_value_t get_tx_sensor(
const std::string &name,
size_t chan = 0) = 0;
856 virtual std::vector<std::string> get_tx_sensor_names(
size_t chan = 0) = 0;
864 virtual void set_tx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
873 virtual void set_tx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 0;
884 virtual std::vector<std::string> get_gpio_banks(
const size_t mboard) = 0;
902 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;
920 virtual boost::uint32_t get_gpio_attr(
const std::string &bank,
const std::string &attr,
const size_t mboard = 0) = 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:514
Definition: stream_cmd.hpp:46
UHD_DEPRECATED bool get_tx_lo_locked(size_t chan=0)
Definition: multi_usrp.hpp:809
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:757
#define UHD_DEPRECATED
Definition: config.hpp:70
void set_tx_gain(double gain, size_t chan=0)
A convenience wrapper for setting overall TX gain.
Definition: multi_usrp.hpp:743
Definition: time_spec.hpp:39
boost::shared_ptr< device > sptr
Definition: device.hpp:41
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:500
Definition: tune_request.hpp:33
boost::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:126
static const std::string ALL_GAINS
A wildcard gain element name.
Definition: multi_usrp.hpp:105
#define UHD_API
Definition: config.hpp:79
Definition: convert.hpp:28
Definition: sensors.hpp:38
Definition: clock_config.hpp:36
Definition: multi_usrp.hpp:94
Definition: stream.hpp:40
UHD_DEPRECATED bool get_rx_lo_locked(size_t chan=0)
Definition: multi_usrp.hpp:552
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:486
Definition: subdev_spec.hpp:66
UHD_DEPRECATED double read_rssi(size_t chan=0)
Definition: multi_usrp.hpp:583
boost::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:198
gain_range_t get_tx_gain_range(size_t chan=0)
A convenience wrapper for getting overall TX gain range.
Definition: multi_usrp.hpp:771
Definition: device_addr.hpp:47