From f57f616cfd6406cd67681813d464695c8c160f9e Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 14 Apr 2010 17:19:27 -0700 Subject: Added gain control to rfx. Switched string constants to caps (gains, antennas, subdevs). Made dboard interface for aux dac and adc use volts. --- host/include/uhd/usrp/dboard_iface.hpp | 8 ++++---- host/include/uhd/utils/algorithm.hpp | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'host/include') diff --git a/host/include/uhd/usrp/dboard_iface.hpp b/host/include/uhd/usrp/dboard_iface.hpp index ca40bf778..71c7be200 100644 --- a/host/include/uhd/usrp/dboard_iface.hpp +++ b/host/include/uhd/usrp/dboard_iface.hpp @@ -82,18 +82,18 @@ public: * * \param unit which unit rx or tx * \param which_dac the dac index 0, 1, 2, 3... - * \param value the value to write + * \param value the value in volts */ - virtual void write_aux_dac(unit_t unit, int which_dac, int value) = 0; + virtual void write_aux_dac(unit_t unit, int which_dac, float value) = 0; /*! * Read from an aux adc. * * \param unit which unit rx or tx * \param which_adc the adc index 0, 1, 2, 3... - * \return the value that was read + * \return the value in volts */ - virtual int read_aux_adc(unit_t unit, int which_adc) = 0; + virtual float read_aux_adc(unit_t unit, int which_adc) = 0; /*! * Set a daughterboard ATR register. diff --git a/host/include/uhd/utils/algorithm.hpp b/host/include/uhd/utils/algorithm.hpp index 6635c8a4a..cc935b226 100644 --- a/host/include/uhd/utils/algorithm.hpp +++ b/host/include/uhd/utils/algorithm.hpp @@ -49,12 +49,16 @@ namespace std{ return has(iterable.begin(), iterable.end(), elem); } - template T signum(T n){ + template T signum(T n){ if (n < 0) return -1; if (n > 0) return 1; return 0; } + template T clip(T val, T1 minVal, T2 maxVal){ + return std::min(std::max(val, minVal), maxVal); + } + }//namespace std #endif /* INCLUDED_UHD_UTILS_ALGORITHM_HPP */ -- cgit v1.2.3