diff options
author | Josh Blum <josh@joshknows.com> | 2010-04-14 17:19:27 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-04-14 17:19:27 -0700 |
commit | f57f616cfd6406cd67681813d464695c8c160f9e (patch) | |
tree | 22a3281776b50b052d0788a4ca4f35ddff56659e /host/include | |
parent | 6d0a60b95777ba6f99a00b4e5ef63f845dfa0aec (diff) | |
download | uhd-f57f616cfd6406cd67681813d464695c8c160f9e.tar.gz uhd-f57f616cfd6406cd67681813d464695c8c160f9e.tar.bz2 uhd-f57f616cfd6406cd67681813d464695c8c160f9e.zip |
Added gain control to rfx. Switched string constants to caps (gains, antennas, subdevs).
Made dboard interface for aux dac and adc use volts.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/usrp/dboard_iface.hpp | 8 | ||||
-rw-r--r-- | host/include/uhd/utils/algorithm.hpp | 6 |
2 files changed, 9 insertions, 5 deletions
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<typename T> T signum(T n){ + template<class T> T signum(T n){ if (n < 0) return -1; if (n > 0) return 1; return 0; } + template<class T, class T1, class T2> T clip(T val, T1 minVal, T2 maxVal){ + return std::min<T>(std::max<T>(val, minVal), maxVal); + } + }//namespace std #endif /* INCLUDED_UHD_UTILS_ALGORITHM_HPP */ |