aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/lib/mykonos
diff options
context:
space:
mode:
authorMark Meserve <mark.meserve@ni.com>2017-09-27 17:43:18 -0500
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:04:01 -0800
commitc309da44616bf910cf526723217c021856576f4d (patch)
tree4f7bb222d1d8afaa6692423d95459936d2096931 /mpm/lib/mykonos
parent3f8dcf16213d5e06a49a0dd3746de1cb290a1f48 (diff)
downloaduhd-c309da44616bf910cf526723217c021856576f4d.tar.gz
uhd-c309da44616bf910cf526723217c021856576f4d.tar.bz2
uhd-c309da44616bf910cf526723217c021856576f4d.zip
ad937x: add comments to ad937x_gain_ctrl_config
Diffstat (limited to 'mpm/lib/mykonos')
-rw-r--r--mpm/lib/mykonos/config/ad937x_gain_ctrl_config.cpp1
-rw-r--r--mpm/lib/mykonos/config/ad937x_gain_ctrl_config.hpp35
2 files changed, 19 insertions, 17 deletions
diff --git a/mpm/lib/mykonos/config/ad937x_gain_ctrl_config.cpp b/mpm/lib/mykonos/config/ad937x_gain_ctrl_config.cpp
index f52982a96..7785a3adb 100644
--- a/mpm/lib/mykonos/config/ad937x_gain_ctrl_config.cpp
+++ b/mpm/lib/mykonos/config/ad937x_gain_ctrl_config.cpp
@@ -120,6 +120,7 @@ ad937x_gain_ctrl_config_t::ad937x_gain_ctrl_config_t(gain_pins_t gain_pins)
{
config.emplace(std::piecewise_construct, std::forward_as_tuple(RX_DIRECTION), std::forward_as_tuple());
config.emplace(std::piecewise_construct, std::forward_as_tuple(TX_DIRECTION), std::forward_as_tuple());
+
config.at(RX_DIRECTION).emplace(std::piecewise_construct, std::forward_as_tuple(chain_t::ONE),
std::forward_as_tuple(
_get_gain_pin(RX_DIRECTION, chain_t::ONE, pin_direction_t::INCREASE, gain_pins),
diff --git a/mpm/lib/mykonos/config/ad937x_gain_ctrl_config.hpp b/mpm/lib/mykonos/config/ad937x_gain_ctrl_config.hpp
index 37c84e36c..065cdec3f 100644
--- a/mpm/lib/mykonos/config/ad937x_gain_ctrl_config.hpp
+++ b/mpm/lib/mykonos/config/ad937x_gain_ctrl_config.hpp
@@ -20,27 +20,11 @@
#include "../ad937x_device_types.hpp"
#include "../adi/t_mykonos.h"
-// TODO: fix paths for the config subfolder
-#include "../../../include/mpm/ad937x/ad937x_ctrl_types.hpp"
+#include "mpm/ad937x/ad937x_ctrl_types.hpp"
#include <vector>
#include <unordered_map>
-struct ad937x_gain_ctrl_channel_t
-{
- uint8_t enable;
- uint8_t inc_step;
- uint8_t dec_step;
- mykonosGpioSelect_t inc_pin;
- mykonosGpioSelect_t dec_pin;
-
- ad937x_gain_ctrl_channel_t(mykonosGpioSelect_t inc_pin, mykonosGpioSelect_t dec_pin);
-
-private:
- const static uint8_t DEFAULT_GAIN_STEP;
- const static bool DEFAULT_ENABLE;
-};
-
// C++14 requires std::hash includes a specialization for enums, but gcc doesn't do that yet
// Remove this when that happens
namespace std {
@@ -61,6 +45,23 @@ namespace std {
};
}
+// collection of the 5 attributes that define the gain pins for a channel in Mykonos
+struct ad937x_gain_ctrl_channel_t
+{
+ uint8_t enable;
+ uint8_t inc_step;
+ uint8_t dec_step;
+ mykonosGpioSelect_t inc_pin;
+ mykonosGpioSelect_t dec_pin;
+
+ ad937x_gain_ctrl_channel_t(mykonosGpioSelect_t inc_pin, mykonosGpioSelect_t dec_pin);
+
+private:
+ const static uint8_t DEFAULT_GAIN_STEP;
+ const static bool DEFAULT_ENABLE;
+};
+
+// logically maps ad937x_gain_ctrl_channels by direction and channel number
struct ad937x_gain_ctrl_config_t
{
std::unordered_map<uhd::direction_t,