aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/magnesium/magnesium_gain_table.hpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-11-07 15:41:46 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:05 -0800
commitdb6264c28e2f460e605fd5781f5188067ab4743b (patch)
treed906ac50633b197a18655523e47e61afae214815 /host/lib/usrp/dboard/magnesium/magnesium_gain_table.hpp
parent298304b1192ac44d5732d16439ff9c84e09922ef (diff)
downloaduhd-db6264c28e2f460e605fd5781f5188067ab4743b.tar.gz
uhd-db6264c28e2f460e605fd5781f5188067ab4743b.tar.bz2
uhd-db6264c28e2f460e605fd5781f5188067ab4743b.zip
mg: Add static gain tables and -support
- Adds two new compilation units (magnesium_gain_table.* and magnesium_radio_ctrl_gain.cpp) - Static gain tables are hard-coded in that file, includes method to look up gain table entries for a given frequency and gain - DSA code moved back to accept attenuation - TX/RX switch code needed update to enable bypass for certain gains
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_gain_table.hpp')
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_gain_table.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_gain_table.hpp b/host/lib/usrp/dboard/magnesium/magnesium_gain_table.hpp
new file mode 100644
index 000000000..e3af493b1
--- /dev/null
+++ b/host/lib/usrp/dboard/magnesium/magnesium_gain_table.hpp
@@ -0,0 +1,40 @@
+//
+// Copyright 2017 Ettus Research, a National Instruments Company
+//
+// SPDX-License-Identifier: GPL-3.0
+//
+
+#ifndef INCLUDED_LIBUHD_MAGNESIUM_GAIN_TABLE_HPP
+#define INCLUDED_LIBUHD_MAGNESIUM_GAIN_TABLE_HPP
+
+#include <uhd/types/direction.hpp>
+
+namespace magnesium {
+
+/*! Store all gain-table related settings for the N310 (Magnesium) daughterboard
+ *
+ * For every requested gain value, one of these will be returned. Works for TX
+ * and RX paths.
+ */
+struct gain_tuple_t
+{
+ //! Attenuation value of the DSA in dB
+ double dsa_att;
+ //! Attenuation value of Mykonos (AD9371) in dB
+ double ad9371_att;
+ //! If true, bypass LNA or PA section
+ bool bypass;
+};
+
+
+/*! Given a gain index, return a tuple of gain-related settings
+ */
+gain_tuple_t get_gain_tuple(
+ const double gain_index,
+ const double freq,
+ const uhd::direction_t dir
+);
+
+} /* namespace magnesium */
+
+#endif