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;
101 static const size_t ALL_MBOARDS = size_t(~0);
104 static const size_t ALL_CHANS = size_t(~0);
161 virtual void set_master_clock_rate(
double rate,
size_t mboard = ALL_MBOARDS) = 0;
168 virtual double get_master_clock_rate(
size_t mboard = 0) = 0;
174 virtual std::string get_pp_string(
void) = 0;
181 virtual std::string get_mboard_name(
size_t mboard = 0) = 0;
188 virtual time_spec_t get_time_now(
size_t mboard = 0) = 0;
195 virtual time_spec_t get_time_last_pps(
size_t mboard = 0) = 0;
208 virtual void set_time_now(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
222 virtual void set_time_next_pps(
const time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
239 virtual void set_time_unknown_pps(
const time_spec_t &time_spec) = 0;
247 virtual bool get_time_synchronized(
void) = 0;
259 virtual void set_command_time(
const uhd::time_spec_t &time_spec,
size_t mboard = ALL_MBOARDS) = 0;
266 virtual void clear_command_time(
size_t mboard = ALL_MBOARDS) = 0;
280 virtual void issue_stream_cmd(
const stream_cmd_t &stream_cmd,
size_t chan = ALL_CHANS) = 0;
290 virtual void set_clock_config(
const clock_config_t &clock_config,
size_t mboard = ALL_MBOARDS) = 0;
300 virtual void set_time_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
307 virtual std::string get_time_source(
const size_t mboard) = 0;
314 virtual std::vector<std::string> get_time_sources(
const size_t mboard) = 0;
323 virtual void set_clock_source(
const std::string &source,
const size_t mboard = ALL_MBOARDS) = 0;
330 virtual std::string get_clock_source(
const size_t mboard) = 0;
337 virtual std::vector<std::string> get_clock_sources(
const size_t mboard) = 0;
347 virtual void set_clock_source_out(
const bool enb,
const size_t mboard = ALL_MBOARDS) = 0;
357 virtual void set_time_source_out(
const bool enb,
const size_t mboard = ALL_MBOARDS) = 0;
362 virtual size_t get_num_mboards(
void) = 0;
370 virtual sensor_value_t get_mboard_sensor(
const std::string &name,
size_t mboard = 0) = 0;
377 virtual std::vector<std::string> get_mboard_sensor_names(
size_t mboard = 0) = 0;
386 virtual void set_user_register(
const boost::uint8_t addr,
const boost::uint32_t data,
size_t mboard = ALL_MBOARDS) = 0;
413 virtual size_t get_rx_num_channels(
void) = 0;
420 virtual std::string get_rx_subdev_name(
size_t chan = 0) = 0;
427 virtual void set_rx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
434 virtual double get_rx_rate(
size_t chan = 0) = 0;
458 virtual double get_rx_freq(
size_t chan = 0) = 0;
469 virtual freq_range_t get_rx_freq_range(
size_t chan = 0) = 0;
476 virtual freq_range_t get_fe_rx_freq_range(
size_t chan = 0) = 0;
485 virtual void set_rx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
489 return this->set_rx_gain(gain, ALL_GAINS, chan);
499 virtual double get_rx_gain(
const std::string &name,
size_t chan = 0) = 0;
503 return this->get_rx_gain(ALL_GAINS, chan);
513 virtual gain_range_t get_rx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
517 return this->get_rx_gain_range(ALL_GAINS, chan);
526 virtual std::vector<std::string> get_rx_gain_names(
size_t chan = 0) = 0;
533 virtual void set_rx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
540 virtual std::string get_rx_antenna(
size_t chan = 0) = 0;
547 virtual std::vector<std::string> get_rx_antennas(
size_t chan = 0) = 0;
554 virtual void set_rx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
561 virtual double get_rx_bandwidth(
size_t chan = 0) = 0;
568 virtual meta_range_t get_rx_bandwidth_range(
size_t chan = 0) = 0;
585 virtual sensor_value_t get_rx_sensor(
const std::string &name,
size_t chan = 0) = 0;
592 virtual std::vector<std::string> get_rx_sensor_names(
size_t chan = 0) = 0;
606 virtual void set_rx_dc_offset(
const bool enb,
size_t chan = ALL_CHANS) = 0;
615 virtual void set_rx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
624 virtual void set_rx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 0;
651 virtual size_t get_tx_num_channels(
void) = 0;
658 virtual std::string get_tx_subdev_name(
size_t chan = 0) = 0;
665 virtual void set_tx_rate(
double rate,
size_t chan = ALL_CHANS) = 0;
672 virtual double get_tx_rate(
size_t chan = 0) = 0;
696 virtual double get_tx_freq(
size_t chan = 0) = 0;
707 virtual freq_range_t get_tx_freq_range(
size_t chan = 0) = 0;
714 virtual freq_range_t get_fe_tx_freq_range(
size_t chan = 0) = 0;
723 virtual void set_tx_gain(
double gain,
const std::string &name,
size_t chan = 0) = 0;
727 return this->set_tx_gain(gain, ALL_GAINS, chan);
737 virtual double get_tx_gain(
const std::string &name,
size_t chan = 0) = 0;
741 return this->get_tx_gain(ALL_GAINS, chan);
751 virtual gain_range_t get_tx_gain_range(
const std::string &name,
size_t chan = 0) = 0;
755 return this->get_tx_gain_range(ALL_GAINS, chan);
764 virtual std::vector<std::string> get_tx_gain_names(
size_t chan = 0) = 0;
771 virtual void set_tx_antenna(
const std::string &ant,
size_t chan = 0) = 0;
778 virtual std::string get_tx_antenna(
size_t chan = 0) = 0;
785 virtual std::vector<std::string> get_tx_antennas(
size_t chan = 0) = 0;
792 virtual void set_tx_bandwidth(
double bandwidth,
size_t chan = 0) = 0;
799 virtual double get_tx_bandwidth(
size_t chan = 0) = 0;
806 virtual meta_range_t get_tx_bandwidth_range(
size_t chan = 0) = 0;
823 virtual sensor_value_t get_tx_sensor(
const std::string &name,
size_t chan = 0) = 0;
830 virtual std::vector<std::string> get_tx_sensor_names(
size_t chan = 0) = 0;
838 virtual void set_tx_dc_offset(
const std::complex<double> &offset,
size_t chan = ALL_CHANS) = 0;
847 virtual void set_tx_iq_balance(
const std::complex<double> &correction,
size_t chan = ALL_CHANS) = 0;
858 virtual std::vector<std::string> get_gpio_banks(
const size_t mboard) = 0;
876 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;
894 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:516
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:740
void set_tx_gain(double gain, size_t chan=0)
A convenience wrapper for setting overall TX gain.
Definition: multi_usrp.hpp:726
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:502
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:107
#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
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:488
Definition: subdev_spec.hpp:66
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:754
Definition: device_addr.hpp:47