Merge commit 'v3.3.0' into upstream
[debian/gnuradio] / usrp / host / lib / db_flexrf_mimo.cc
1 /*
2  * Copyright 2008,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 version 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
22 #ifdef HAVE_CONFIG_H
23 #include "config.h"
24 #endif
25
26 #include <usrp/db_flexrf_mimo.h>
27 #include <fpga_regs_standard.h>
28 #include <fpga_regs_common.h>
29 #include <usrp/usrp_prims.h>
30 #include <usrp_spi_defs.h>
31
32
33 db_flexrf_2400_tx_mimo_a::db_flexrf_2400_tx_mimo_a(usrp_basic_sptr usrp, int which)
34   : db_flexrf_2400_tx(usrp, which)
35 {
36   _enable_refclk(true);
37   d_common->R_DIV(1);
38 }
39
40 int 
41 db_flexrf_2400_tx_mimo_a::_refclk_divisor()
42 {
43   return 16;
44 }
45
46 db_flexrf_2400_rx_mimo_a::db_flexrf_2400_rx_mimo_a(usrp_basic_sptr usrp, int which)
47   : db_flexrf_2400_rx(usrp, which)
48 {
49   _enable_refclk(true);
50   d_common->R_DIV(1);
51 }
52
53 int 
54 db_flexrf_2400_rx_mimo_a::_refclk_divisor()
55 {
56   return 16;
57 }
58       
59 db_flexrf_2400_tx_mimo_b::db_flexrf_2400_tx_mimo_b(usrp_basic_sptr usrp, int which)
60   : db_flexrf_2400_tx(usrp, which)
61 {
62   d_common->R_DIV(16);
63 }
64
65 int 
66 db_flexrf_2400_tx_mimo_b::_refclk_divisor()
67 {
68   return 1;
69 }
70
71 db_flexrf_2400_rx_mimo_b::db_flexrf_2400_rx_mimo_b(usrp_basic_sptr usrp, int which)
72   : db_flexrf_2400_rx(usrp, which)
73 {
74   d_common->R_DIV(16);
75 }
76
77 int 
78 db_flexrf_2400_rx_mimo_b::_refclk_divisor()
79 {
80   return 1;
81 }
82
83 db_flexrf_1800_tx_mimo_a::db_flexrf_1800_tx_mimo_a(usrp_basic_sptr usrp, int which)
84   : db_flexrf_1800_tx(usrp, which)
85 {
86   _enable_refclk(true);
87   d_common->R_DIV(1);
88 }
89
90 int 
91 db_flexrf_1800_tx_mimo_a::_refclk_divisor()
92 {
93   return 16;
94 }
95
96 db_flexrf_1800_rx_mimo_a::db_flexrf_1800_rx_mimo_a(usrp_basic_sptr usrp, int which)
97   : db_flexrf_1800_rx(usrp, which)
98 {
99   _enable_refclk(true);
100   d_common->R_DIV(1);
101 }
102
103 int 
104 db_flexrf_1800_rx_mimo_a::_refclk_divisor()
105 {
106   return 16;
107 }
108     
109 db_flexrf_1800_tx_mimo_b::db_flexrf_1800_tx_mimo_b(usrp_basic_sptr usrp, int which)
110   : db_flexrf_1800_tx(usrp, which)
111 {
112   d_common->R_DIV(16);
113 }
114
115 int 
116 db_flexrf_1800_tx_mimo_b::_refclk_divisor()
117 {
118   return 1;
119 }
120
121 db_flexrf_1800_rx_mimo_b::db_flexrf_1800_rx_mimo_b(usrp_basic_sptr usrp, int which)
122   : db_flexrf_1800_rx(usrp, which)
123 {
124   d_common->R_DIV(16);
125 }
126
127 int 
128 db_flexrf_1800_rx_mimo_b::_refclk_divisor()
129 {
130   return 1;
131 }
132
133 db_flexrf_1200_tx_mimo_a::db_flexrf_1200_tx_mimo_a(usrp_basic_sptr usrp, int which)
134   : db_flexrf_1200_tx(usrp, which)
135 {
136   _enable_refclk(true);
137   d_common->R_DIV(1);
138 }
139
140 int 
141 db_flexrf_1200_tx_mimo_a::_refclk_divisor()
142 {
143   return 16;
144 }
145
146 db_flexrf_1200_rx_mimo_a::db_flexrf_1200_rx_mimo_a(usrp_basic_sptr usrp, int which)
147   : db_flexrf_1200_rx(usrp, which)
148 {
149   _enable_refclk(true);
150   d_common->R_DIV(1);
151 }
152
153 int 
154 db_flexrf_1200_rx_mimo_a::_refclk_divisor()
155 {
156   return 16;
157 }
158     
159 db_flexrf_1200_tx_mimo_b::db_flexrf_1200_tx_mimo_b(usrp_basic_sptr usrp, int which)
160   : db_flexrf_1200_tx(usrp, which)
161 {
162   d_common->R_DIV(16);
163 }
164
165 int 
166 db_flexrf_1200_tx_mimo_b::_refclk_divisor()
167 {
168   return 1;
169 }
170
171 db_flexrf_1200_rx_mimo_b::db_flexrf_1200_rx_mimo_b(usrp_basic_sptr usrp, int which)
172   : db_flexrf_1200_rx(usrp, which)
173 {
174   d_common->R_DIV(16);
175 }
176
177 int 
178 db_flexrf_1200_rx_mimo_b::_refclk_divisor()
179 {
180   return 1;
181 }
182
183 db_flexrf_900_tx_mimo_a::db_flexrf_900_tx_mimo_a(usrp_basic_sptr usrp, int which)
184   : db_flexrf_900_tx(usrp, which)
185 {
186   _enable_refclk(true);
187   d_common->R_DIV(1);
188 }
189
190 int 
191 db_flexrf_900_tx_mimo_a::_refclk_divisor()
192 {
193   return 16;
194 }
195
196 db_flexrf_900_rx_mimo_a::db_flexrf_900_rx_mimo_a(usrp_basic_sptr usrp, int which)
197   : db_flexrf_900_rx(usrp, which)
198 {
199   _enable_refclk(true);
200   d_common->R_DIV(1);
201 }
202
203 int 
204 db_flexrf_900_rx_mimo_a::_refclk_divisor()
205 {
206   return 16;
207 }
208     
209 db_flexrf_900_tx_mimo_b::db_flexrf_900_tx_mimo_b(usrp_basic_sptr usrp, int which)
210   : db_flexrf_900_tx(usrp, which)
211 {
212   d_common->R_DIV(16);
213 }
214
215 int 
216 db_flexrf_900_tx_mimo_b::_refclk_divisor()
217 {
218   return 1;
219 }
220
221 db_flexrf_900_rx_mimo_b::db_flexrf_900_rx_mimo_b(usrp_basic_sptr usrp, int which)
222   : db_flexrf_900_rx(usrp, which)
223 {
224   d_common->R_DIV(16);
225 }
226
227 int db_flexrf_900_rx_mimo_b::_refclk_divisor()
228 {
229   return 1;
230 }
231
232 db_flexrf_400_tx_mimo_a::db_flexrf_400_tx_mimo_a(usrp_basic_sptr usrp, int which)
233   : db_flexrf_400_tx(usrp, which)
234 {
235   _enable_refclk(true);
236   d_common->R_DIV(1);
237 }
238
239 int 
240 db_flexrf_400_tx_mimo_a::_refclk_divisor()
241 {
242   return 16;
243 }
244     
245 db_flexrf_400_rx_mimo_a::db_flexrf_400_rx_mimo_a(usrp_basic_sptr usrp, int which)
246   : db_flexrf_400_rx(usrp, which)
247 {
248   _enable_refclk(true);
249   d_common->R_DIV(1);
250 }
251
252 int 
253 db_flexrf_400_rx_mimo_a::_refclk_divisor()
254 {
255   return 16;
256 }
257     
258 db_flexrf_400_tx_mimo_b::db_flexrf_400_tx_mimo_b(usrp_basic_sptr usrp, int which)
259   : db_flexrf_400_tx(usrp, which)
260 {
261   d_common->R_DIV(16);
262 }
263
264 int 
265 db_flexrf_400_tx_mimo_b::_refclk_divisor()
266 {
267   return 1;
268 }
269     
270 db_flexrf_400_rx_mimo_b::db_flexrf_400_rx_mimo_b(usrp_basic_sptr usrp, int which)
271   : db_flexrf_400_rx(usrp, which)
272 {
273   d_common->R_DIV(16);
274 }
275
276 int 
277 db_flexrf_400_rx_mimo_b::_refclk_divisor()
278 {
279   return 1;
280 }