summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-29 00:45:26 -0700
committerJosh Blum <josh@joshknows.com>2010-03-29 00:45:26 -0700
commit86fffe7f9ed78a682879dd56c26628256f89e6ae (patch)
treedbad6c804cadc80baf69fd53fe86ee251d2a28f6 /host/include
parent3b02823640f3d7724c4d517114698285e914d735 (diff)
downloaduhd-86fffe7f9ed78a682879dd56c26628256f89e6ae.tar.gz
uhd-86fffe7f9ed78a682879dd56c26628256f89e6ae.tar.bz2
uhd-86fffe7f9ed78a682879dd56c26628256f89e6ae.zip
Added tune helper to utils.
Takes a subdevice and dxc properties object and tunes them. Made use of tune helper in simple device. Moved gain handler into utils header dir.
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/CMakeLists.txt1
-rw-r--r--host/include/uhd/utils/CMakeLists.txt2
-rw-r--r--host/include/uhd/utils/gain_handler.hpp (renamed from host/include/uhd/gain_handler.hpp)6
-rw-r--r--host/include/uhd/utils/tune_helper.hpp79
4 files changed, 84 insertions, 4 deletions
diff --git a/host/include/uhd/CMakeLists.txt b/host/include/uhd/CMakeLists.txt
index 0cebea095..b364f78cd 100644
--- a/host/include/uhd/CMakeLists.txt
+++ b/host/include/uhd/CMakeLists.txt
@@ -24,7 +24,6 @@ ADD_SUBDIRECTORY(utils)
INSTALL(FILES
config.hpp
device.hpp
- gain_handler.hpp
props.hpp
simple_device.hpp
wax.hpp
diff --git a/host/include/uhd/utils/CMakeLists.txt b/host/include/uhd/utils/CMakeLists.txt
index f6ed87701..1b673f44a 100644
--- a/host/include/uhd/utils/CMakeLists.txt
+++ b/host/include/uhd/utils/CMakeLists.txt
@@ -18,7 +18,9 @@
INSTALL(FILES
algorithm.hpp
assert.hpp
+ gain_handler.hpp
safe_main.hpp
static.hpp
+ tune_helper.hpp
DESTINATION ${INCLUDE_DIR}/uhd/utils
)
diff --git a/host/include/uhd/gain_handler.hpp b/host/include/uhd/utils/gain_handler.hpp
index 65d6cecf9..f4629e6a7 100644
--- a/host/include/uhd/gain_handler.hpp
+++ b/host/include/uhd/utils/gain_handler.hpp
@@ -15,8 +15,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#ifndef INCLUDED_UHD_GAIN_HANDLER_HPP
-#define INCLUDED_UHD_GAIN_HANDLER_HPP
+#ifndef INCLUDED_UHD_UTILS_GAIN_HANDLER_HPP
+#define INCLUDED_UHD_UTILS_GAIN_HANDLER_HPP
#include <uhd/config.hpp>
#include <uhd/wax.hpp>
@@ -86,5 +86,5 @@ public:
} //namespace uhd
-#endif /* INCLUDED_UHD_GAIN_HANDLER_HPP */
+#endif /* INCLUDED_UHD_UTILS_GAIN_HANDLER_HPP */
diff --git a/host/include/uhd/utils/tune_helper.hpp b/host/include/uhd/utils/tune_helper.hpp
new file mode 100644
index 000000000..828575c99
--- /dev/null
+++ b/host/include/uhd/utils/tune_helper.hpp
@@ -0,0 +1,79 @@
+//
+// Copyright 2010 Ettus Research LLC
+//
+// This program 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 version 3 of the License, or
+// (at your option) any later version.
+//
+// This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#ifndef INCLUDED_UHD_UTILS_TUNE_HELPER_HPP
+#define INCLUDED_UHD_UTILS_TUNE_HELPER_HPP
+
+#include <uhd/config.hpp>
+#include <uhd/wax.hpp>
+#include <uhd/types/tune_result.hpp>
+
+namespace uhd{
+
+/*!
+ * Tune a rx chain to the desired frequency:
+ * The IF of the subdevice is set as close as possible to
+ * the given target frequency + the LO offset (when applicable).
+ * The ddc cordic is setup to bring the IF down to baseband.
+ * \param subdev the dboard subdevice object with properties
+ * \param ddc the ddc properties object (with "rate", "decim", "freq")
+ * \param target_freq the desired center frequency
+ * \param lo_offset an offset for the subdevice IF from center
+ * \return a tune result struct
+ */
+UHD_API tune_result_t tune_rx_subdev_and_ddc(
+ wax::obj subdev, wax::obj ddc,
+ double target_freq, double lo_offset
+);
+
+/*!
+ * Tune a rx chain to the desired frequency:
+ * Same as the above, except the LO offset
+ * is calculated based on the subdevice and BW.
+ */
+UHD_API tune_result_t tune_rx_subdev_and_ddc(
+ wax::obj subdev, wax::obj ddc, double target_freq
+);
+
+/*!
+ * Tune a tx chain to the desired frequency:
+ * The IF of the subdevice is set as close as possible to
+ * the given target frequency + the LO offset (when applicable).
+ * The duc cordic is setup to bring the baseband up to IF.
+ * \param subdev the dboard subdevice object with properties
+ * \param duc the duc properties object (with "rate", "interp", "freq")
+ * \param target_freq the desired center frequency
+ * \param lo_offset an offset for the subdevice IF from center
+ * \return a tune result struct
+ */
+UHD_API tune_result_t tune_tx_subdev_and_duc(
+ wax::obj subdev, wax::obj duc,
+ double target_freq, double lo_offset
+);
+
+/*!
+ * Tune a tx chain to the desired frequency:
+ * Same as the above, except the LO offset
+ * is calculated based on the subdevice and BW.
+ */
+UHD_API tune_result_t tune_tx_subdev_and_duc(
+ wax::obj subdev, wax::obj duc, double target_freq
+);
+
+} //namespace uhd
+
+#endif /* INCLUDED_UHD_UTILS_TUNE_HELPER_HPP */