USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-gdca39145
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 //
4 // SPDX-License-Identifier: GPL-3.0
5 //
6 
7 #ifndef INCLUDED_UHD_USRP_DBOARD_IFACE_HPP
8 #define INCLUDED_UHD_USRP_DBOARD_IFACE_HPP
9 
10 #include <uhd/config.hpp>
11 #include <uhd/utils/pimpl.hpp>
12 #include <uhd/types/serial.hpp>
13 #include <uhd/types/time_spec.hpp>
15 #include <uhd/usrp/gpio_defs.hpp>
16 #include <boost/shared_ptr.hpp>
17 #include <stdint.h>
18 #include <boost/thread/thread.hpp>
19 #include <string>
20 #include <vector>
21 
22 namespace uhd{ namespace usrp{
23 
33 
43 };
44 
52 public:
53  typedef boost::shared_ptr<dboard_iface> sptr;
55 
57  enum unit_t{
58  UNIT_RX = int('r'),
59  UNIT_TX = int('t'),
60  UNIT_BOTH = int('b'),
61  };
62 
64  enum aux_dac_t{
65  AUX_DAC_A = int('a'),
66  AUX_DAC_B = int('b'),
67  AUX_DAC_C = int('c'),
68  AUX_DAC_D = int('d')
69  };
70 
72  enum aux_adc_t{
73  AUX_ADC_A = int('a'),
74  AUX_ADC_B = int('b')
75  };
76 
78 
79  virtual ~dboard_iface(void) {};
80 
87  virtual special_props_t get_special_props(void) = 0;
88 
96  virtual void write_aux_dac(unit_t unit, aux_dac_t which_dac, double value) = 0;
97 
105  virtual double read_aux_adc(unit_t unit, aux_adc_t which_adc) = 0;
106 
114  virtual void set_pin_ctrl(
115  unit_t unit, uint32_t value, uint32_t mask = 0xffff
116  ) = 0;
117 
124  virtual uint32_t get_pin_ctrl(unit_t unit) = 0;
125 
134  virtual void set_atr_reg(
135  unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffff
136  ) = 0;
137 
145  virtual uint32_t get_atr_reg(unit_t unit, atr_reg_t reg) = 0;
146 
154  virtual void set_gpio_ddr(
155  unit_t unit, uint32_t value, uint32_t mask = 0xffff
156  ) = 0;
157 
164  virtual uint32_t get_gpio_ddr(unit_t unit) = 0;
165 
173  virtual void set_gpio_out(
174  unit_t unit, uint32_t value, uint32_t mask = 0xffff
175  ) = 0;
176 
183  virtual uint32_t get_gpio_out(unit_t unit) = 0;
184 
191  virtual uint32_t read_gpio(unit_t unit) = 0;
192 
201  virtual void write_spi(
202  unit_t unit,
203  const spi_config_t &config,
204  uint32_t data,
205  size_t num_bits
206  ) = 0;
207 
217  virtual uint32_t read_write_spi(
218  unit_t unit,
219  const spi_config_t &config,
220  uint32_t data,
221  size_t num_bits
222  ) = 0;
223 
230  virtual void set_clock_rate(unit_t unit, double rate) = 0;
231 
238  virtual double get_clock_rate(unit_t unit) = 0;
239 
246  virtual std::vector<double> get_clock_rates(unit_t unit) = 0;
247 
254  virtual void set_clock_enabled(unit_t unit, bool enb) = 0;
255 
263  virtual double get_codec_rate(unit_t unit) = 0;
264 
272  virtual void set_fe_connection(
273  unit_t unit,
274  const std::string& fe_name,
275  const uhd::usrp::fe_connection_t& fe_conn
276  ) = 0;
277 
282  virtual uhd::time_spec_t get_command_time(void) = 0;
283 
288  virtual void set_command_time(const uhd::time_spec_t& t) = 0;
289 
294  virtual void sleep(const boost::chrono::nanoseconds& time);
295 };
296 
297 }} //namespace
298 
299 #endif /* INCLUDED_UHD_USRP_DBOARD_IFACE_HPP */
virtual ~dboard_iface(void)
Definition: dboard_iface.hpp:79
aux_adc_t
aux adc selection enums (per unit)
Definition: dboard_iface.hpp:72
Definition: serial.hpp:34
uhd::usrp::gpio_atr::gpio_atr_reg_t atr_reg_t
Definition: dboard_iface.hpp:77
Definition: time_spec.hpp:28
aux_dac_t
aux dac selection enums (per unit)
Definition: dboard_iface.hpp:64
Definition: build_info.hpp:14
Definition: dboard_iface.hpp:51
bool soft_clock_divider
Definition: dboard_iface.hpp:32
Definition: serial.hpp:94
Definition: fe_connection.hpp:16
gpio_atr_reg_t
Definition: gpio_defs.hpp:17
#define UHD_API
Definition: config.h:62
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:86
boost::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:53
dboard_iface_special_props_t special_props_t
Definition: dboard_iface.hpp:54
Special properties that differentiate this daughterboard slot.
Definition: dboard_iface.hpp:25
unit_t
tells the host which unit to use
Definition: dboard_iface.hpp:57
bool mangle_i2c_addrs
Definition: dboard_iface.hpp:42