USRP Hardware Driver and USRP Manual  Version: 4.4.0.HEAD-0-g5fac246b
UHD and USRP Manual
dboard_iface.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2013,2015-2016 Ettus Research LLC
3 // Copyright 2018 Ettus Research, a National Instruments Company
4 //
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 
8 #pragma once
9 
10 #include <uhd/config.hpp>
11 #include <uhd/types/serial.hpp>
12 #include <uhd/types/time_spec.hpp>
14 #include <uhd/usrp/gpio_defs.hpp>
15 #include <uhd/utils/pimpl.hpp>
16 #include <stdint.h>
17 #include <chrono>
18 #include <memory>
19 #include <string>
20 #include <vector>
21 
22 namespace uhd { namespace usrp {
23 
26 {
34 
44 };
45 
53 {
54 public:
55  typedef std::shared_ptr<dboard_iface> sptr;
57 
59  enum unit_t {
60  UNIT_RX = int('r'),
61  UNIT_TX = int('t'),
62  UNIT_BOTH = int('b'),
63  };
64 
66  enum aux_dac_t {
67  AUX_DAC_A = int('a'),
68  AUX_DAC_B = int('b'),
69  AUX_DAC_C = int('c'),
70  AUX_DAC_D = int('d')
71  };
72 
74  enum aux_adc_t { AUX_ADC_A = int('a'), AUX_ADC_B = int('b') };
75 
77 
78  ~dboard_iface(void) override{};
79 
86  virtual special_props_t get_special_props(void) = 0;
87 
95  virtual void write_aux_dac(unit_t unit, aux_dac_t which_dac, double value) = 0;
96 
104  virtual double read_aux_adc(unit_t unit, aux_adc_t which_adc) = 0;
105 
113  virtual void set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask = 0xffff) = 0;
114 
121  virtual uint32_t get_pin_ctrl(unit_t unit) = 0;
122 
131  virtual void set_atr_reg(
132  unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffff) = 0;
133 
141  virtual uint32_t get_atr_reg(unit_t unit, atr_reg_t reg) = 0;
142 
150  virtual void set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask = 0xffff) = 0;
151 
158  virtual uint32_t get_gpio_ddr(unit_t unit) = 0;
159 
167  virtual void set_gpio_out(unit_t unit, uint32_t value, uint32_t mask = 0xffff) = 0;
168 
175  virtual uint32_t get_gpio_out(unit_t unit) = 0;
176 
183  virtual uint32_t read_gpio(unit_t unit) = 0;
184 
193  virtual void write_spi(
194  unit_t unit, const spi_config_t& config, uint32_t data, size_t num_bits) = 0;
195 
205  virtual uint32_t read_write_spi(
206  unit_t unit, const spi_config_t& config, uint32_t data, size_t num_bits) = 0;
207 
214  virtual void set_clock_rate(unit_t unit, double rate) = 0;
215 
222  virtual double get_clock_rate(unit_t unit) = 0;
223 
230  virtual std::vector<double> get_clock_rates(unit_t unit) = 0;
231 
238  virtual void set_clock_enabled(unit_t unit, bool enb) = 0;
239 
247  virtual double get_codec_rate(unit_t unit) = 0;
248 
256  virtual void set_fe_connection(unit_t unit,
257  const std::string& fe_name,
258  const uhd::usrp::fe_connection_t& fe_conn) = 0;
259 
262  virtual bool has_set_fe_connection(const unit_t)
263  {
264  return false;
265  }
266 
271  virtual uhd::time_spec_t get_command_time(void) = 0;
272 
277  virtual void set_command_time(const uhd::time_spec_t& t) = 0;
278 
283  virtual void sleep(const std::chrono::nanoseconds& time);
284 };
285 
286 }} // namespace uhd::usrp
uhd::soft_reg_field::mask
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:86
gpio_defs.hpp
uhd::usrp::dboard_iface
Definition: dboard_iface.hpp:52
uhd::usrp::dboard_iface::special_props_t
dboard_iface_special_props_t special_props_t
Definition: dboard_iface.hpp:56
time_spec.hpp
config.hpp
uhd::usrp::dboard_iface::has_set_fe_connection
virtual bool has_set_fe_connection(const unit_t)
Definition: dboard_iface.hpp:262
uhd::usrp::dboard_iface_special_props_t::mangle_i2c_addrs
bool mangle_i2c_addrs
Definition: dboard_iface.hpp:43
pimpl.hpp
UHD_API
#define UHD_API
Definition: config.h:87
uhd::usrp::dboard_iface::sptr
std::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:55
fe_connection.hpp
uhd::usrp::dboard_iface_special_props_t
Special properties that differentiate this daughterboard slot.
Definition: dboard_iface.hpp:25
uhd::usrp::dboard_iface_special_props_t::soft_clock_divider
bool soft_clock_divider
Definition: dboard_iface.hpp:33
uhd::usrp::dboard_iface::atr_reg_t
uhd::usrp::gpio_atr::gpio_atr_reg_t atr_reg_t
Definition: dboard_iface.hpp:76
uhd
Definition: build_info.hpp:12
uhd::time_spec_t
Definition: time_spec.hpp:28
uhd::usrp::dboard_iface::unit_t
unit_t
tells the host which unit to use
Definition: dboard_iface.hpp:59
uhd::usrp::gpio_atr::gpio_atr_reg_t
gpio_atr_reg_t
Definition: gpio_defs.hpp:12
uhd::usrp::dboard_iface::aux_adc_t
aux_adc_t
aux adc selection enums (per unit)
Definition: dboard_iface.hpp:74
serial.hpp
uhd::usrp::dboard_iface::aux_dac_t
aux_dac_t
aux dac selection enums (per unit)
Definition: dboard_iface.hpp:66
uhd::i2c_iface
Definition: serial.hpp:35
uhd::spi_config_t
Definition: serial.hpp:82
uhd::usrp::fe_connection_t
Definition: fe_connection.hpp:16
uhd::usrp::dboard_iface::~dboard_iface
~dboard_iface(void) override
Definition: dboard_iface.hpp:78