diff options
Diffstat (limited to 'mpm/lib/mykonos/config/ad937x_gain_ctrl_config.hpp')
-rw-r--r-- | mpm/lib/mykonos/config/ad937x_gain_ctrl_config.hpp | 35 |
1 files changed, 18 insertions, 17 deletions
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, |