summaryrefslogtreecommitdiff
path: root/usrp/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'usrp/host/include')
-rw-r--r--usrp/host/include/usrp/Makefile.am1
-rw-r--r--usrp/host/include/usrp/db_bitshark_rx.h56
-rw-r--r--usrp/host/include/usrp/db_flexrf.h40
-rw-r--r--usrp/host/include/usrp/db_wbxng.h39
4 files changed, 108 insertions, 28 deletions
diff --git a/usrp/host/include/usrp/Makefile.am b/usrp/host/include/usrp/Makefile.am
index cfce51443..2aaf66a53 100644
--- a/usrp/host/include/usrp/Makefile.am
+++ b/usrp/host/include/usrp/Makefile.am
@@ -26,6 +26,7 @@ usrpincludedir = $(includedir)/usrp
usrpinclude_HEADERS = \
db_base.h \
db_basic.h \
+ db_bitshark_rx.h \
db_dbs_rx.h \
db_dtt754.h \
db_dtt768.h \
diff --git a/usrp/host/include/usrp/db_bitshark_rx.h b/usrp/host/include/usrp/db_bitshark_rx.h
new file mode 100644
index 000000000..f81877d28
--- /dev/null
+++ b/usrp/host/include/usrp/db_bitshark_rx.h
@@ -0,0 +1,56 @@
+/* -*- c++ -*- */
+//
+// Copyright 2010 Free Software Foundation, Inc.
+//
+// This file is part of GNU Radio
+//
+// GNU Radio is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either asversion 3, or (at your option)
+// any later version.
+//
+// GNU Radio is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU Radio; see the file COPYING. If not, write to
+// the Free Software Foundation, Inc., 51 Franklin Street,
+// Boston, MA 02110-1301, USA.
+
+#ifndef DB_BITSHARK_RX_H
+#define DB_BITSHARK_RX_H
+
+#include <usrp/db_base.h>
+#include <vector>
+#include <stdint.h>
+
+class db_bitshark_rx : public db_base
+{
+private:
+ int d_i2c_addr;
+ // Internal function for interfacing to the card
+ void _set_pga(int pga_gain);
+
+protected:
+ void shutdown();
+
+public:
+ db_bitshark_rx(usrp_basic_sptr usrp, int which);
+ ~db_bitshark_rx();
+
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
+ double freq_min();
+ double freq_max();
+ struct freq_result_t set_freq(double freq);
+ bool set_gain(float gain);
+ bool set_bw(float bw);
+ bool set_clock_scheme(uint8_t clock_scheme, uint32_t ref_clock_freq);
+ bool is_quadrature();
+ bool i_and_q_swapped();
+};
+
+#endif
diff --git a/usrp/host/include/usrp/db_flexrf.h b/usrp/host/include/usrp/db_flexrf.h
index 0c834402d..70a55514e 100644
--- a/usrp/host/include/usrp/db_flexrf.h
+++ b/usrp/host/include/usrp/db_flexrf.h
@@ -138,6 +138,18 @@ protected:
//----------------------------------------------------------------------
+class _2200_common : public _AD4360_common
+{
+ public:
+ _2200_common();
+ ~_2200_common() {}
+
+ double freq_min();
+ double freq_max();
+};
+
+//----------------------------------------------------------------------
+
class _2400_common : public _AD4360_common
{
public:
@@ -212,6 +224,34 @@ public:
//------------------------------------------------------------
+class db_flexrf_2200_tx : public flexrf_base_tx
+{
+ public:
+ db_flexrf_2200_tx(usrp_basic_sptr usrp, int which);
+ ~db_flexrf_2200_tx();
+
+ // Wrapper calls to d_common functions
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
+};
+
+class db_flexrf_2200_rx : public flexrf_base_rx
+{
+public:
+ db_flexrf_2200_rx(usrp_basic_sptr usrp, int which);
+ ~db_flexrf_2200_rx();
+
+ float gain_min();
+ float gain_max();
+ float gain_db_per_step();
+ bool i_and_q_swapped();
+
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
+};
+
+//------------------------------------------------------------
+
class db_flexrf_2400_tx : public flexrf_base_tx
{
public:
diff --git a/usrp/host/include/usrp/db_wbxng.h b/usrp/host/include/usrp/db_wbxng.h
index 8611d4787..9a7829278 100644
--- a/usrp/host/include/usrp/db_wbxng.h
+++ b/usrp/host/include/usrp/db_wbxng.h
@@ -30,7 +30,7 @@ class adf4350;
class wbxng_base : public db_base
{
public:
- wbxng_base(usrp_basic_sptr usrp, int which, int _power_on=0);
+ wbxng_base(usrp_basic_sptr usrp, int which);
~wbxng_base();
struct freq_result_t set_freq(double freq);
@@ -40,31 +40,30 @@ public:
double freq_max();
protected:
- bool _lock_detect();
+ void _write_spi(std::string data);
+ int _refclk_divisor();
+ bool _get_locked();
bool _set_pga(float pga_gain);
- int power_on() { return d_power_on; }
- int power_off() { return 0; }
-
bool d_first;
int d_spi_format;
int d_spi_enable;
int d_power_on;
int d_PD;
- adf4350 *d_common;
+ boost::shared_ptr<adf4350> d_common;
};
// ----------------------------------------------------------------
-class wbxng_base_tx : public wbxng_base
+class db_wbxng_tx : public wbxng_base
{
protected:
void shutdown();
public:
- wbxng_base_tx(usrp_basic_sptr usrp, int which, int _power_on=0);
- ~wbxng_base_tx();
+ db_wbxng_tx(usrp_basic_sptr usrp, int which);
+ ~db_wbxng_tx();
float gain_min();
float gain_max();
@@ -75,36 +74,20 @@ public:
bool set_gain(float gain);
};
-class wbxng_base_rx : public wbxng_base
+class db_wbxng_rx : public wbxng_base
{
protected:
void shutdown();
bool _set_attn(float attn);
public:
- wbxng_base_rx(usrp_basic_sptr usrp, int which, int _power_on=0);
- ~wbxng_base_rx();
+ db_wbxng_rx(usrp_basic_sptr usrp, int which);
+ ~db_wbxng_rx();
bool set_auto_tr(bool on);
bool select_rx_antenna(int which_antenna);
bool select_rx_antenna(const std::string &which_antenna);
bool set_gain(float gain);
-};
-
-// ----------------------------------------------------------------
-
-class db_wbxng_tx : public wbxng_base_tx
-{
- public:
- db_wbxng_tx(usrp_basic_sptr usrp, int which);
- ~db_wbxng_tx();
-};
-
-class db_wbxng_rx : public wbxng_base_rx
-{
-public:
- db_wbxng_rx(usrp_basic_sptr usrp, int which);
- ~db_wbxng_rx();
float gain_min();
float gain_max();