set antenna defaults to 0
[debian/gnuradio] / usrp2 / firmware / lib / db_basic.c
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008,2009 Free Software Foundation, Inc.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19
20 #include <db_base.h>
21
22 bool db_basic_init(struct db_base *db);
23 bool db_basic_set_freq(struct db_base *db, u2_fxpt_freq_t freq, u2_fxpt_freq_t *dc);
24 bool db_basic_set_gain(struct db_base *db, u2_fxpt_gain_t gain);
25 bool db_basic_set_tx_enable(struct db_base *, bool on);
26
27 struct db_basic {
28   struct db_base        base;
29 };
30
31
32 struct db_basic db_basic_tx = {
33   .base.dbid = 0x0000,
34   .base.is_tx = true,
35   .base.output_enables = 0x0000,
36   .base.used_pins = 0x0000,
37   .base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(-90e9),
38   .base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(90e9),
39   .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
40   .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(0),
41   .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(0),
42   .base.is_quadrature = true,
43   .base.i_and_q_swapped = false,
44   .base.spectrum_inverted = false,
45   .base.default_lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
46   .base.atr_mask =      0,
47   .base.atr_txval =     0,
48   .base.atr_rxval =     0,
49   //.base.atr_tx_delay =        0,
50   //.base.atr_rx_delay =        0,
51
52   .base.init = db_basic_init,
53   .base.set_freq = db_basic_set_freq,
54   .base.set_gain = db_basic_set_gain,
55   .base.set_tx_enable = db_basic_set_tx_enable,
56   .base.set_antenna = 0,
57 };
58
59 struct db_basic db_basic_rx = {
60   .base.dbid = 0x0001,
61   .base.is_tx = false,
62   .base.output_enables = 0x0000,
63   .base.used_pins = 0x0000,
64   .base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(-90e9),
65   .base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(90e9),
66   .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
67   .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(0),
68   .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(0),
69   .base.is_quadrature = false,
70   .base.i_and_q_swapped = false,
71   .base.spectrum_inverted = false,
72   .base.default_lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
73   .base.atr_mask =      0,
74   .base.atr_txval =     0,
75   .base.atr_rxval =     0,
76   //.base.atr_tx_delay =        0,
77   //.base.atr_rx_delay =        0,
78
79   .base.init = db_basic_init,
80   .base.set_freq = db_basic_set_freq,
81   .base.set_gain = db_basic_set_gain,
82   .base.set_tx_enable = db_basic_set_tx_enable,
83   .base.set_antenna = 0,
84 };
85
86 struct db_basic db_lf_tx = {
87   .base.dbid = 0x000e,
88   .base.is_tx = true,
89   .base.output_enables = 0x0000,
90   .base.used_pins = 0x0000,
91   .base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(-32e6),
92   .base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(32e6),
93   .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
94   .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(0),
95   .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(0),
96   .base.is_quadrature = true,
97   .base.i_and_q_swapped = false,
98   .base.spectrum_inverted = false,
99   .base.default_lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
100   .base.atr_mask =      0,
101   .base.atr_txval =     0,
102   .base.atr_rxval =     0,
103   //.base.atr_tx_delay =        0,
104   //.base.atr_rx_delay =        0,
105
106   .base.init = db_basic_init,
107   .base.set_freq = db_basic_set_freq,
108   .base.set_gain = db_basic_set_gain,
109   .base.set_tx_enable = db_basic_set_tx_enable,
110   .base.set_antenna = 0,
111 };
112
113 struct db_basic db_lf_rx = {
114   .base.dbid = 0x000f,
115   .base.is_tx = false,
116   .base.output_enables = 0x0000,
117   .base.used_pins = 0x0000,
118   .base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(0),
119   .base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(32e6),
120   .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
121   .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(0),
122   .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(0),
123   .base.is_quadrature = false,
124   .base.i_and_q_swapped = false,
125   .base.spectrum_inverted = false,
126   .base.default_lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
127   .base.atr_mask =      0,
128   .base.atr_txval =     0,
129   .base.atr_rxval =     0,
130   //.base.atr_tx_delay =        0,
131   //.base.atr_rx_delay =        0,
132
133   .base.init = db_basic_init,
134   .base.set_freq = db_basic_set_freq,
135   .base.set_gain = db_basic_set_gain,
136   .base.set_tx_enable = db_basic_set_tx_enable,
137   .base.set_antenna = 0,
138 };
139
140
141 bool
142 db_basic_init(struct db_base *db)
143 {
144   return true;
145 }
146
147 bool
148 db_basic_set_freq(struct db_base *db, u2_fxpt_freq_t freq, u2_fxpt_freq_t *dc)
149 {
150   *dc = 0;
151   return true;
152 }
153
154 bool
155 db_basic_set_gain(struct db_base *db, u2_fxpt_gain_t gain)
156 {
157   return true;
158 }
159
160 bool
161 db_basic_set_tx_enable(struct db_base *db, bool on)
162 {
163   return true;
164 }
165