aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/usrp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-05-30 13:46:24 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:10 -0800
commit4d5ae0cc69424ecc9a7fcc0943d22832e5f37b8d (patch)
tree5186c357e2923023366adca2cb83fd81e66416ec /host/lib/include/uhdlib/usrp
parente250da5003bcc7a7068e54b11ba86e51563255be (diff)
downloaduhd-4d5ae0cc69424ecc9a7fcc0943d22832e5f37b8d.tar.gz
uhd-4d5ae0cc69424ecc9a7fcc0943d22832e5f37b8d.tar.bz2
uhd-4d5ae0cc69424ecc9a7fcc0943d22832e5f37b8d.zip
lib: utils: Add new signature to get_freq_and_freq_word()
The new signature uses tuple as the return value, instead of passing in output variables as references (C-style).
Diffstat (limited to 'host/lib/include/uhdlib/usrp')
-rw-r--r--host/lib/include/uhdlib/usrp/cores/dsp_core_utils.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/host/lib/include/uhdlib/usrp/cores/dsp_core_utils.hpp b/host/lib/include/uhdlib/usrp/cores/dsp_core_utils.hpp
index 739b973cb..2632f4a1f 100644
--- a/host/lib/include/uhdlib/usrp/cores/dsp_core_utils.hpp
+++ b/host/lib/include/uhdlib/usrp/cores/dsp_core_utils.hpp
@@ -8,7 +8,7 @@
#ifndef INCLUDED_LIBUHD_DSP_CORE_UTILS_HPP
#define INCLUDED_LIBUHD_DSP_CORE_UTILS_HPP
-#include <stdint.h>
+#include <tuple>
/*! For a requested frequency and sampling rate, return the
* correct frequency word (to set the CORDIC) and the actual frequency.
@@ -20,4 +20,10 @@ void get_freq_and_freq_word(
int32_t &freq_word
);
+/*! For a requested frequency and sampling rate, return the
+ * correct frequency word (to set the CORDIC) and the actual frequency.
+ */
+std::tuple<double, int> get_freq_and_freq_word(
+ const double requested_freq, const double tick_rate);
+
#endif /* INCLUDED_LIBUHD_DSP_CORE_UTILS_HPP */