USRP Hardware Driver and USRP Manual  Version: 3.13.0.HEAD-0-gf114cfa0
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 #ifndef INCLUDED_UHD_USRP_DBOARD_IFACE_HPP
9 #define INCLUDED_UHD_USRP_DBOARD_IFACE_HPP
10 
11 #include <uhd/config.hpp>
12 #include <uhd/utils/pimpl.hpp>
13 #include <uhd/types/serial.hpp>
14 #include <uhd/types/time_spec.hpp>
16 #include <uhd/usrp/gpio_defs.hpp>
17 #include <boost/shared_ptr.hpp>
18 #include <stdint.h>
19 #include <boost/thread/thread.hpp>
20 #include <string>
21 #include <vector>
22 
23 namespace uhd{ namespace usrp{
24 
34 
44 };
45 
53 public:
54  typedef boost::shared_ptr<dboard_iface> sptr;
56 
58  enum unit_t{
59  UNIT_RX = int('r'),
60  UNIT_TX = int('t'),
61  UNIT_BOTH = int('b'),
62  };
63 
65  enum aux_dac_t{
66  AUX_DAC_A = int('a'),
67  AUX_DAC_B = int('b'),
68  AUX_DAC_C = int('c'),
69  AUX_DAC_D = int('d')
70  };
71 
73  enum aux_adc_t{
74  AUX_ADC_A = int('a'),
75  AUX_ADC_B = int('b')
76  };
77 
79 
80  virtual ~dboard_iface(void) {};
81 
88  virtual special_props_t get_special_props(void) = 0;
89 
97  virtual void write_aux_dac(unit_t unit, aux_dac_t which_dac, double value) = 0;
98 
106  virtual double read_aux_adc(unit_t unit, aux_adc_t which_adc) = 0;
107 
115  virtual void set_pin_ctrl(
116  unit_t unit, uint32_t value, uint32_t mask = 0xffff
117  ) = 0;
118 
125  virtual uint32_t get_pin_ctrl(unit_t unit) = 0;
126 
135  virtual void set_atr_reg(
136  unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffff
137  ) = 0;
138 
146  virtual uint32_t get_atr_reg(unit_t unit, atr_reg_t reg) = 0;
147 
155  virtual void set_gpio_ddr(
156  unit_t unit, uint32_t value, uint32_t mask = 0xffff
157  ) = 0;
158 
165  virtual uint32_t get_gpio_ddr(unit_t unit) = 0;
166 
174  virtual void set_gpio_out(
175  unit_t unit, uint32_t value, uint32_t mask = 0xffff
176  ) = 0;
177 
184  virtual uint32_t get_gpio_out(unit_t unit) = 0;
185 
192  virtual uint32_t read_gpio(unit_t unit) = 0;
193 
202  virtual void write_spi(
203  unit_t unit,
204  const spi_config_t &config,
205  uint32_t data,
206  size_t num_bits
207  ) = 0;
208 
218  virtual uint32_t read_write_spi(
219  unit_t unit,
220  const spi_config_t &config,
221  uint32_t data,
222  size_t num_bits
223  ) = 0;
224 
231  virtual void set_clock_rate(unit_t unit, double rate) = 0;
232 
239  virtual double get_clock_rate(unit_t unit) = 0;
240 
247  virtual std::vector<double> get_clock_rates(unit_t unit) = 0;
248 
255  virtual void set_clock_enabled(unit_t unit, bool enb) = 0;
256 
264  virtual double get_codec_rate(unit_t unit) = 0;
265 
273  virtual void set_fe_connection(
274  unit_t unit,
275  const std::string& fe_name,
276  const uhd::usrp::fe_connection_t& fe_conn
277  ) = 0;
278 
281  virtual bool has_set_fe_connection(const unit_t) { return false; }
282 
287  virtual uhd::time_spec_t get_command_time(void) = 0;
288 
293  virtual void set_command_time(const uhd::time_spec_t& t) = 0;
294 
299  virtual void sleep(const boost::chrono::nanoseconds& time);
300 };
301 
302 }} //namespace
303 
304 #endif /* INCLUDED_UHD_USRP_DBOARD_IFACE_HPP */
virtual ~dboard_iface(void)
Definition: dboard_iface.hpp:80
aux_adc_t
aux adc selection enums (per unit)
Definition: dboard_iface.hpp:73
Definition: serial.hpp:35
uhd::usrp::gpio_atr::gpio_atr_reg_t atr_reg_t
Definition: dboard_iface.hpp:78
Definition: time_spec.hpp:29
aux_dac_t
aux dac selection enums (per unit)
Definition: dboard_iface.hpp:65
Definition: build_info.hpp:14
Definition: dboard_iface.hpp:52
bool soft_clock_divider
Definition: dboard_iface.hpp:33
Definition: serial.hpp:95
Definition: fe_connection.hpp:17
gpio_atr_reg_t
Definition: gpio_defs.hpp:13
#define UHD_API
Definition: config.h:63
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:87
boost::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:54
dboard_iface_special_props_t special_props_t
Definition: dboard_iface.hpp:55
Special properties that differentiate this daughterboard slot.
Definition: dboard_iface.hpp:26
virtual bool has_set_fe_connection(const unit_t)
Definition: dboard_iface.hpp:281
unit_t
tells the host which unit to use
Definition: dboard_iface.hpp:58
bool mangle_i2c_addrs
Definition: dboard_iface.hpp:43