Refactor WBX and adf4350 to avoid passing usrp pointer
[debian/gnuradio] / usrp / host / lib / db_wbxng_adf4350_regs.h
1 //
2 // Copyright 2009 Free Software Foundation, Inc.
3 //
4 // This file is part of GNU Radio
5 //
6 // GNU Radio is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either asversion 3, or (at your option)
9 // any later version.
10 //
11 // GNU Radio is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with GNU Radio; see the file COPYING.  If not, write to
18 // the Free Software Foundation, Inc., 51 Franklin Street,
19 // Boston, MA 02110-1301, USA.
20
21 #ifndef ADF4350_REGS_H
22 #define ADF4350_REGS_H
23
24 #include <usrp/db_base.h>
25 #include <stdint.h>
26
27 class adf4350;
28
29 class adf4350_regs
30 {
31 public:
32     adf4350_regs();
33     ~adf4350_regs();
34
35     uint32_t _reg_shift(uint32_t data, uint32_t shift);
36     uint32_t compute_register(uint8_t addr);
37
38     /* reg 0 */
39     uint16_t d_int;
40     uint16_t d_frac;
41     /* reg 1 */
42     uint8_t d_prescaler;
43     static const uint16_t s_phase;
44     uint16_t d_mod;
45     /* reg 2 */
46     static const uint8_t s_low_noise_and_low_spur_modes;
47     static const uint8_t s_muxout;
48     static const uint8_t s_reference_doubler;
49     static const uint8_t s_rdiv2;
50     uint16_t d_10_bit_r_counter;
51     static const uint8_t s_double_buff;
52     static const uint8_t s_charge_pump_setting;
53     static const uint8_t s_ldf;
54     static const uint8_t s_ldp;
55     static const uint8_t s_pd_polarity;
56     static const uint8_t s_power_down;
57     static const uint8_t s_cp_three_state;
58     static const uint8_t s_counter_reset;
59     /* reg 3 */
60     static const uint8_t s_csr;
61     static const uint8_t s_clk_div_mode;
62     static const uint16_t s_12_bit_clock_divider_value;
63     /* reg 4 */
64     static const uint8_t s_feedback_select;
65     uint8_t d_divider_select;
66     uint8_t d_8_bit_band_select_clock_divider_value;
67     static const uint8_t s_vco_power_down;
68     static const uint8_t s_mtld;
69     static const uint8_t s_aux_output_select;
70     static const uint8_t s_aux_output_enable;
71     static const uint8_t s_aux_output_power;
72     static const uint8_t s_rf_output_enable;
73     static const uint8_t s_output_power;
74     /* reg 5 */
75     static const uint8_t s_ld_pin_mode;
76
77 protected:
78     usrp_basic_sptr d_usrp;
79     int d_spi_enable;
80     int d_spi_format;
81 };
82
83 #endif /* ADF4350_REGS_H */