switch source package format to 3.0 quilt
[debian/gnuradio] / usrp2 / firmware / lib / db_wbxng.h
1 /*
2  * Copyright 2010 Free Software Foundation, Inc.
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
19 #ifndef DB_WBXNG_H
20 #define DB_WBXNG_H
21
22 #include <db_base.h>
23
24 // IO Pin functions
25 // Tx and Rx have shared defs, but different i/o regs
26 #define ENABLE_5        (1 << 7)              // enables 5.0V power supply
27 #define ENABLE_33       (1 << 6)              // enables 3.3V supply
28 //#define RX_TXN          (1 << 15)             // Tx only: T/R antenna switch for TX/RX port
29 //#define RX2_RX1N        (1 << 15)             // Rx only: antenna switch between RX2 and TX/RX port
30 #define RX_TXN          ((1 << 5)|(1 << 15))  // Tx only: T/R antenna switch for TX/RX port
31 #define RX2_RX1N        ((1 << 5)|(1 << 15))  // Rx only: antenna switch between RX2 and TX/RX port
32 #define RXBB_EN         (1 << 4)
33 #define TXMOD_EN        (1 << 4)
34 #define PLL_CE          (1 << 3)
35 #define PLL_PDBRF       (1 << 2)
36 #define PLL_MUXOUT      (1 << 1)
37 #define PLL_LOCK_DETECT (1 << 0)
38
39 // RX Attenuator constants
40 #define ATTN_SHIFT      8
41 #define ATTN_MASK       (63 << ATTN_SHIFT)
42
43 struct db_wbxng_common {
44   // RFX common stuff
45   uint16_t adf4350_regs_int;
46   uint16_t adf4350_regs_frac;
47   uint8_t adf4350_regs_prescaler;
48   uint16_t adf4350_regs_mod;
49   uint16_t adf4350_regs_10_bit_r_counter;
50   uint8_t adf4350_regs_divider_select;
51   uint8_t adf4350_regs_8_bit_band_select_clock_divider_value;
52
53   int freq_mult;
54   int spi_mask;
55 };
56
57 struct db_wbxng_dummy {
58   struct db_base        base;
59   struct db_wbxng_common        common;
60 };
61
62
63 struct db_wbxng_rx {
64   struct db_base        base;
65   struct db_wbxng_common        common;
66 };
67
68 struct db_wbxng_tx {
69   struct db_base        base;
70   struct db_wbxng_common        common;
71 };
72
73
74 #endif /* DB_WBXNG_H */