aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/usrp/common
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/include/uhdlib/usrp/common')
-rw-r--r--host/lib/include/uhdlib/usrp/common/adf435x.hpp28
-rw-r--r--host/lib/include/uhdlib/usrp/common/max287x.hpp62
-rw-r--r--host/lib/include/uhdlib/usrp/common/mpmd_mb_controller.hpp52
-rw-r--r--host/lib/include/uhdlib/usrp/common/recv_packet_demuxer_3000.hpp14
4 files changed, 82 insertions, 74 deletions
diff --git a/host/lib/include/uhdlib/usrp/common/adf435x.hpp b/host/lib/include/uhdlib/usrp/common/adf435x.hpp
index de93bfd69..8c47c94fd 100644
--- a/host/lib/include/uhdlib/usrp/common/adf435x.hpp
+++ b/host/lib/include/uhdlib/usrp/common/adf435x.hpp
@@ -139,19 +139,19 @@ public:
{
}
- virtual ~adf435x_impl(){};
+ ~adf435x_impl() override{};
- void set_reference_freq(double fref)
+ void set_reference_freq(double fref) override
{
_reference_freq = fref;
}
- void set_feedback_select(feedback_sel_t fb_sel)
+ void set_feedback_select(feedback_sel_t fb_sel) override
{
_fb_after_divider = (fb_sel == FB_SEL_DIVIDED);
}
- void set_prescaler(prescaler_t prescaler)
+ void set_prescaler(prescaler_t prescaler) override
{
if (prescaler == PRESCALER_8_9) {
_regs.prescaler = adf435x_regs_t::PRESCALER_8_9;
@@ -162,7 +162,7 @@ public:
}
}
- void set_output_power(output_t output, output_power_t power)
+ void set_output_power(output_t output, output_power_t power) override
{
switch (output) {
case RF_OUTPUT_A:
@@ -206,7 +206,7 @@ public:
}
}
- void set_output_enable(output_t output, bool enable)
+ void set_output_enable(output_t output, bool enable) override
{
switch (output) {
case RF_OUTPUT_A:
@@ -222,7 +222,7 @@ public:
}
}
- void set_muxout_mode(muxout_t mode)
+ void set_muxout_mode(muxout_t mode) override
{
switch (mode) {
case MUXOUT_3STATE:
@@ -251,7 +251,7 @@ public:
}
}
- void set_tuning_mode(tuning_mode_t mode)
+ void set_tuning_mode(tuning_mode_t mode) override
{
// New mode applies to subsequent tunes i.e. do not re-tune now
_tuning_mode = mode;
@@ -262,7 +262,7 @@ public:
_regs.phase_12_bit = (_tuning_mode == TUNING_MODE_HIGH_RESOLUTION) ? 0 : 1;
}
- void set_charge_pump_current(charge_pump_current_t cp_current)
+ void set_charge_pump_current(charge_pump_current_t cp_current) override
{
switch (cp_current) {
case CHARGE_PUMP_CURRENT_0_31MA:
@@ -318,7 +318,7 @@ public:
}
}
- double set_charge_pump_current(const double current, const bool flush)
+ double set_charge_pump_current(const double current, const bool flush) override
{
const auto cp_range = get_charge_pump_current_range();
@@ -344,19 +344,19 @@ public:
return coerced_current;
}
- uhd::meta_range_t get_charge_pump_current_range()
+ uhd::meta_range_t get_charge_pump_current_range() override
{
return uhd::meta_range_t(.3125e-6, 5e-6, .3125e-6);
}
- uhd::range_t get_int_range()
+ uhd::range_t get_int_range() override
{
if (_N_min < 0)
throw uhd::runtime_error("set_prescaler must be called before get_int_range");
return uhd::range_t(_N_min, 4095);
}
- double set_frequency(double target_freq, bool int_n_mode, bool flush = false)
+ double set_frequency(double target_freq, bool int_n_mode, bool flush = false) override
{
static const double REF_DOUBLER_THRESH_FREQ = 12.5e6;
static const double PFD_FREQ_MAX = 25.0e6;
@@ -531,7 +531,7 @@ public:
return actual_freq;
}
- void commit()
+ void commit() override
{
// reset counters
_regs.counter_reset = adf435x_regs_t::COUNTER_RESET_ENABLED;
diff --git a/host/lib/include/uhdlib/usrp/common/max287x.hpp b/host/lib/include/uhdlib/usrp/common/max287x.hpp
index 5e23649ef..8aa7e947e 100644
--- a/host/lib/include/uhdlib/usrp/common/max287x.hpp
+++ b/host/lib/include/uhdlib/usrp/common/max287x.hpp
@@ -224,24 +224,26 @@ class max287x : public max287x_iface
{
public:
max287x(write_fn func);
- virtual ~max287x();
- virtual void power_up(void);
- virtual void shutdown(void);
- virtual bool is_shutdown(void);
- virtual double set_frequency(
- double target_freq, double ref_freq, double target_pfd_freq, bool is_int_n);
- virtual void set_output_power(output_power_t power);
- virtual void set_ld_pin_mode(ld_pin_mode_t mode);
- virtual void set_muxout_mode(muxout_mode_t mode);
- virtual void set_charge_pump_current(charge_pump_current_t cp_current);
- virtual void set_auto_retune(bool enabled);
- virtual void set_clock_divider_mode(clock_divider_mode_t mode);
- virtual void set_cycle_slip_mode(bool enabled);
- virtual void set_low_noise_and_spur(low_noise_and_spur_t mode);
- virtual void set_phase(uint16_t phase);
- virtual void commit();
- virtual bool can_sync();
- virtual void config_for_sync(bool enable);
+ ~max287x() override;
+ void power_up(void) override;
+ void shutdown(void) override;
+ bool is_shutdown(void) override;
+ double set_frequency(double target_freq,
+ double ref_freq,
+ double target_pfd_freq,
+ bool is_int_n) override;
+ void set_output_power(output_power_t power) override;
+ void set_ld_pin_mode(ld_pin_mode_t mode) override;
+ void set_muxout_mode(muxout_mode_t mode) override;
+ void set_charge_pump_current(charge_pump_current_t cp_current) override;
+ void set_auto_retune(bool enabled) override;
+ void set_clock_divider_mode(clock_divider_mode_t mode) override;
+ void set_cycle_slip_mode(bool enabled) override;
+ void set_low_noise_and_spur(low_noise_and_spur_t mode) override;
+ void set_phase(uint16_t phase) override;
+ void commit() override;
+ bool can_sync() override;
+ void config_for_sync(bool enable) override;
protected:
max287x_regs_t _regs;
@@ -261,9 +263,11 @@ class max2870 : public max287x<max2870_regs_t>
{
public:
max2870(write_fn func) : max287x<max2870_regs_t>(func) {}
- ~max2870() {}
- double set_frequency(
- double target_freq, double ref_freq, double target_pfd_freq, bool is_int_n)
+ ~max2870() override {}
+ double set_frequency(double target_freq,
+ double ref_freq,
+ double target_pfd_freq,
+ bool is_int_n) override
{
_regs.cpoc = is_int_n ? max2870_regs_t::CPOC_ENABLED
: max2870_regs_t::CPOC_DISABLED;
@@ -274,7 +278,7 @@ public:
return max287x<max2870_regs_t>::set_frequency(
target_freq, ref_freq, target_pfd_freq, is_int_n);
}
- void commit(void)
+ void commit(void) override
{
// For MAX2870, we always need to write all registers.
_write_all_regs = true;
@@ -354,8 +358,8 @@ class max2871 : public max287x<max2871_regs_t>
{
public:
max2871(write_fn func) : max287x<max2871_regs_t>(func) {}
- ~max2871(){};
- void set_muxout_mode(muxout_mode_t mode)
+ ~max2871() override{};
+ void set_muxout_mode(muxout_mode_t mode) override
{
switch (mode) {
case MUXOUT_SYNC:
@@ -369,8 +373,10 @@ public:
}
}
- double set_frequency(
- double target_freq, double ref_freq, double target_pfd_freq, bool is_int_n)
+ double set_frequency(double target_freq,
+ double ref_freq,
+ double target_pfd_freq,
+ bool is_int_n) override
{
_regs.feedback_select = max2871_regs_t::FEEDBACK_SELECT_DIVIDED;
double freq = max287x<max2871_regs_t>::set_frequency(
@@ -414,7 +420,7 @@ public:
return freq;
}
- void commit()
+ void commit() override
{
max287x<max2871_regs_t>::commit();
@@ -883,7 +889,7 @@ void max287x<max287x_regs_t>::commit()
try {
changed_regs = _regs.template get_changed_addrs<uint32_t>();
// register 0 must be written to apply double buffered fields
- if (changed_regs.size() > 0) {
+ if (!changed_regs.empty()) {
changed_regs.insert(0);
}
diff --git a/host/lib/include/uhdlib/usrp/common/mpmd_mb_controller.hpp b/host/lib/include/uhdlib/usrp/common/mpmd_mb_controller.hpp
index acdd361e4..98e7f2ac4 100644
--- a/host/lib/include/uhdlib/usrp/common/mpmd_mb_controller.hpp
+++ b/host/lib/include/uhdlib/usrp/common/mpmd_mb_controller.hpp
@@ -55,11 +55,11 @@ public:
// nop
}
- uint64_t get_ticks_now();
- uint64_t get_ticks_last_pps();
- void set_ticks_now(const uint64_t ticks);
- void set_ticks_next_pps(const uint64_t ticks);
- void set_period(const uint64_t period_ns);
+ uint64_t get_ticks_now() override;
+ uint64_t get_ticks_last_pps() override;
+ void set_ticks_now(const uint64_t ticks) override;
+ void set_ticks_next_pps(const uint64_t ticks) override;
+ void set_period(const uint64_t period_ns) override;
/*! Update the tick rate
* Note: This is separate from set_tick_rate because the latter is
@@ -75,26 +75,28 @@ public:
/**************************************************************************
* Motherboard Control API (see mb_controller.hpp)
*************************************************************************/
- std::string get_mboard_name() const;
- void set_time_source(const std::string& source);
- std::string get_time_source() const;
- std::vector<std::string> get_time_sources() const;
- void set_clock_source(const std::string& source);
- std::string get_clock_source() const;
- std::vector<std::string> get_clock_sources() const;
- void set_sync_source(const std::string& clock_source, const std::string& time_source);
- void set_sync_source(const uhd::device_addr_t& sync_source);
- uhd::device_addr_t get_sync_source() const;
- std::vector<uhd::device_addr_t> get_sync_sources();
- void set_clock_source_out(const bool enb);
- void set_time_source_out(const bool enb);
- uhd::sensor_value_t get_sensor(const std::string& name);
- std::vector<std::string> get_sensor_names();
- uhd::usrp::mboard_eeprom_t get_eeprom();
- std::vector<std::string> get_gpio_banks() const;
- std::vector<std::string> get_gpio_srcs(const std::string& bank) const;
- std::vector<std::string> get_gpio_src(const std::string& bank);
- void set_gpio_src(const std::string& bank, const std::vector<std::string>& src);
+ std::string get_mboard_name() const override;
+ void set_time_source(const std::string& source) override;
+ std::string get_time_source() const override;
+ std::vector<std::string> get_time_sources() const override;
+ void set_clock_source(const std::string& source) override;
+ std::string get_clock_source() const override;
+ std::vector<std::string> get_clock_sources() const override;
+ void set_sync_source(
+ const std::string& clock_source, const std::string& time_source) override;
+ void set_sync_source(const uhd::device_addr_t& sync_source) override;
+ uhd::device_addr_t get_sync_source() const override;
+ std::vector<uhd::device_addr_t> get_sync_sources() override;
+ void set_clock_source_out(const bool enb) override;
+ void set_time_source_out(const bool enb) override;
+ uhd::sensor_value_t get_sensor(const std::string& name) override;
+ std::vector<std::string> get_sensor_names() override;
+ uhd::usrp::mboard_eeprom_t get_eeprom() override;
+ std::vector<std::string> get_gpio_banks() const override;
+ std::vector<std::string> get_gpio_srcs(const std::string& bank) const override;
+ std::vector<std::string> get_gpio_src(const std::string& bank) override;
+ void set_gpio_src(
+ const std::string& bank, const std::vector<std::string>& src) override;
private:
/**************************************************************************
diff --git a/host/lib/include/uhdlib/usrp/common/recv_packet_demuxer_3000.hpp b/host/lib/include/uhdlib/usrp/common/recv_packet_demuxer_3000.hpp
index 9cbede8e4..0e1041642 100644
--- a/host/lib/include/uhdlib/usrp/common/recv_packet_demuxer_3000.hpp
+++ b/host/lib/include/uhdlib/usrp/common/recv_packet_demuxer_3000.hpp
@@ -117,32 +117,32 @@ struct recv_packet_demuxer_proxy_3000 : transport::zero_copy_if
_demux->realloc_sid(_sid); // causes clear
}
- ~recv_packet_demuxer_proxy_3000(void)
+ ~recv_packet_demuxer_proxy_3000(void) override
{
_demux->realloc_sid(_sid); // causes clear
}
- size_t get_num_recv_frames(void) const
+ size_t get_num_recv_frames(void) const override
{
return _xport->get_num_recv_frames();
}
- size_t get_recv_frame_size(void) const
+ size_t get_recv_frame_size(void) const override
{
return _xport->get_recv_frame_size();
}
- transport::managed_recv_buffer::sptr get_recv_buff(double timeout)
+ transport::managed_recv_buffer::sptr get_recv_buff(double timeout) override
{
return _demux->get_recv_buff(_sid, timeout);
}
- size_t get_num_send_frames(void) const
+ size_t get_num_send_frames(void) const override
{
return _xport->get_num_send_frames();
}
- size_t get_send_frame_size(void) const
+ size_t get_send_frame_size(void) const override
{
return _xport->get_send_frame_size();
}
- transport::managed_send_buffer::sptr get_send_buff(double timeout)
+ transport::managed_send_buffer::sptr get_send_buff(double timeout) override
{
return _xport->get_send_buff(timeout);
}