Statistics
| Branch: | Tag: | Revision:

root / gr-usrp / src / usrp_base.i @ 72c625f7

History | View | Annotate | Download (3.4 kB)

1
/* -*- c++ -*- */
2
/*
3
 * Copyright 2008 Free Software Foundation, Inc.
4
 * 
5
 * This file is part of GNU Radio
6
 * 
7
 * GNU Radio is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 3, or (at your option)
10
 * any later version.
11
 * 
12
 * GNU Radio is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 * 
17
 * You should have received a copy of the GNU General Public License
18
 * along with GNU Radio; see the file COPYING.  If not, write to
19
 * the Free Software Foundation, Inc., 51 Franklin Street,
20
 * Boston, MA 02110-1301, USA.
21
 */
22
23
%{
24
#include "usrp_base.h"
25
%}
26
27
class usrp_base : public gr_sync_block 
28
{
29
protected:
30
  usrp_base(const std::string &name,
31
	    gr_io_signature_sptr input_signature,
32
	    gr_io_signature_sptr output_signature)
33
    : gr_sync_block(name, input_signature, output_signature) {}
34
    
35
public:
36
  std::vector<std::vector<db_base_sptr> > db();
37
  std::vector<db_base_sptr> db(int which_side);
38
  db_base_sptr db(int which_side, int which_dev);
39
  %rename (_real_selected_subdev) selected_subdev;
40
  db_base_sptr selected_subdev(usrp_subdev_spec ss);
41
  long  fpga_master_clock_freq() const;
42
  void set_verbose (bool on);
43
  static const int READ_FAILED = -99999;
44
  bool write_eeprom (int i2c_addr, int eeprom_offset, const std::string buf);
45
  std::string read_eeprom (int i2c_addr, int eeprom_offset, int len);
46
  bool write_i2c (int i2c_addr, const std::string buf);
47
  std::string read_i2c (int i2c_addr, int len);
48
  bool set_adc_offset (int which_adc, int offset);
49
  bool set_dac_offset (int which_dac, int offset, int offset_pin);
50
  bool set_adc_buffer_bypass (int which_adc, bool bypass);
51
  bool set_dc_offset_cl_enable(int bits, int mask);
52
  std::string serial_number();
53
  virtual int daughterboard_id (int which_side) const;
54
  bool write_atr_tx_delay(int value);
55
  bool write_atr_rx_delay(int value);
56
  bool set_pga (int which_amp, double gain_in_db);
57
  double pga (int which_amp) const;
58
  double pga_min () const;
59
  double pga_max () const;
60
  double pga_db_per_step () const;
61
  bool _write_oe (int which_side, int value, int mask);
62
  bool write_io (int which_side, int value, int mask);
63
  int read_io (int which_side);
64
  //bool write_refclk(int which_side, int value);
65
  bool write_atr_mask(int which_side, int value);
66
  bool write_atr_txval(int which_side, int value);
67
  bool write_atr_rxval(int which_side, int value);
68
  bool write_aux_dac (int which_side, int which_dac, int value);
69
  int read_aux_adc (int which_side, int which_adc);
70
  long converter_rate() const;
71
  bool _set_led (int which_led, bool on);
72
  bool _write_fpga_reg (int regno, int value);
73
  //bool _read_fpga_reg (int regno, int *value);
74
  int  _read_fpga_reg (int regno);
75
  bool _write_fpga_reg_masked (int regno, int value, int mask);
76
  bool _write_9862 (int which_codec, int regno, unsigned char value);
77
  int  _read_9862 (int which_codec, int regno) const;
78
  bool _write_spi (int optional_header, int enables, int format, std::string buf);
79
  std::string _read_spi (int optional_header, int enables, int format, int len);
80
  %rename(_real_pick_subdev) pick_subdev;
81
  usrp_subdev_spec pick_subdev(std::vector<int> candidates=std::vector<int>(0))
82
    throw (std::runtime_error);
83
};