USRP Hardware Driver and USRP Manual  Version: 003.010.001.HEAD-0-gc705922a
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 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_UHD_USRP_DBOARD_IFACE_HPP
19 #define INCLUDED_UHD_USRP_DBOARD_IFACE_HPP
20 
21 #include <uhd/config.hpp>
22 #include <uhd/utils/pimpl.hpp>
23 #include <uhd/types/serial.hpp>
24 #include <uhd/types/time_spec.hpp>
26 #include <uhd/usrp/gpio_defs.hpp>
27 #include <boost/shared_ptr.hpp>
28 #include <stdint.h>
29 #include <boost/thread/thread.hpp>
30 #include <string>
31 #include <vector>
32 
33 namespace uhd{ namespace usrp{
34 
44 
54 };
55 
63 public:
64  typedef boost::shared_ptr<dboard_iface> sptr;
66 
68  enum unit_t{
69  UNIT_RX = int('r'),
70  UNIT_TX = int('t'),
71  UNIT_BOTH = int('b'),
72  };
73 
75  enum aux_dac_t{
76  AUX_DAC_A = int('a'),
77  AUX_DAC_B = int('b'),
78  AUX_DAC_C = int('c'),
79  AUX_DAC_D = int('d')
80  };
81 
83  enum aux_adc_t{
84  AUX_ADC_A = int('a'),
85  AUX_ADC_B = int('b')
86  };
87 
89 
90  virtual ~dboard_iface(void) {};
91 
98  virtual special_props_t get_special_props(void) = 0;
99 
107  virtual void write_aux_dac(unit_t unit, aux_dac_t which_dac, double value) = 0;
108 
116  virtual double read_aux_adc(unit_t unit, aux_adc_t which_adc) = 0;
117 
125  virtual void set_pin_ctrl(
126  unit_t unit, uint32_t value, uint32_t mask = 0xffff
127  ) = 0;
128 
135  virtual uint32_t get_pin_ctrl(unit_t unit) = 0;
136 
145  virtual void set_atr_reg(
146  unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffff
147  ) = 0;
148 
156  virtual uint32_t get_atr_reg(unit_t unit, atr_reg_t reg) = 0;
157 
165  virtual void set_gpio_ddr(
166  unit_t unit, uint32_t value, uint32_t mask = 0xffff
167  ) = 0;
168 
175  virtual uint32_t get_gpio_ddr(unit_t unit) = 0;
176 
184  virtual void set_gpio_out(
185  unit_t unit, uint32_t value, uint32_t mask = 0xffff
186  ) = 0;
187 
194  virtual uint32_t get_gpio_out(unit_t unit) = 0;
195 
202  virtual uint32_t read_gpio(unit_t unit) = 0;
203 
212  virtual void write_spi(
213  unit_t unit,
214  const spi_config_t &config,
215  uint32_t data,
216  size_t num_bits
217  ) = 0;
218 
228  virtual uint32_t read_write_spi(
229  unit_t unit,
230  const spi_config_t &config,
231  uint32_t data,
232  size_t num_bits
233  ) = 0;
234 
241  virtual void set_clock_rate(unit_t unit, double rate) = 0;
242 
249  virtual double get_clock_rate(unit_t unit) = 0;
250 
257  virtual std::vector<double> get_clock_rates(unit_t unit) = 0;
258 
265  virtual void set_clock_enabled(unit_t unit, bool enb) = 0;
266 
274  virtual double get_codec_rate(unit_t unit) = 0;
275 
283  virtual void set_fe_connection(
284  unit_t unit,
285  const std::string& fe_name,
286  const uhd::usrp::fe_connection_t& fe_conn
287  ) = 0;
288 
293  virtual uhd::time_spec_t get_command_time(void) = 0;
294 
299  virtual void set_command_time(const uhd::time_spec_t& t) = 0;
300 
305  virtual void sleep(const boost::chrono::nanoseconds& time);
306 };
307 
308 }} //namespace
309 
310 #endif /* INCLUDED_UHD_USRP_DBOARD_IFACE_HPP */
virtual ~dboard_iface(void)
Definition: dboard_iface.hpp:90
aux_adc_t
aux adc selection enums (per unit)
Definition: dboard_iface.hpp:83
Definition: serial.hpp:45
uhd::usrp::gpio_atr::gpio_atr_reg_t atr_reg_t
Definition: dboard_iface.hpp:88
Definition: time_spec.hpp:39
aux_dac_t
aux dac selection enums (per unit)
Definition: dboard_iface.hpp:75
Definition: build_info.hpp:25
Definition: dboard_iface.hpp:62
bool soft_clock_divider
Definition: dboard_iface.hpp:43
Definition: serial.hpp:105
Definition: fe_connection.hpp:27
gpio_atr_reg_t
Definition: gpio_defs.hpp:28
#define UHD_API
Definition: config.h:73
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:98
boost::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:64
dboard_iface_special_props_t special_props_t
Definition: dboard_iface.hpp:65
Special properties that differentiate this daughterboard slot.
Definition: dboard_iface.hpp:36
unit_t
tells the host which unit to use
Definition: dboard_iface.hpp:68
bool mangle_i2c_addrs
Definition: dboard_iface.hpp:53