summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-11 19:46:45 -0800
committerJosh Blum <josh@joshknows.com>2011-01-11 19:46:45 -0800
commit395bbbbc1118b061262a10d5c847f17a4fd0c6ae (patch)
tree6347a18702529cfd42dcb94c37ce2866b49b93f4 /host/include
parent18defbd9d40a4c11a33025c8684f48fe51f102c5 (diff)
downloaduhd-395bbbbc1118b061262a10d5c847f17a4fd0c6ae.tar.gz
uhd-395bbbbc1118b061262a10d5c847f17a4fd0c6ae.tar.bz2
uhd-395bbbbc1118b061262a10d5c847f17a4fd0c6ae.zip
uhd: replace all the instances of float not pertaining to io types with double, simplifies life
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/usrp/codec_props.hpp4
-rw-r--r--host/include/uhd/usrp/dboard_iface.hpp6
-rw-r--r--host/include/uhd/usrp/multi_usrp.hpp18
-rw-r--r--host/include/uhd/usrp/single_usrp.hpp18
-rw-r--r--host/include/uhd/usrp/subdev_props.hpp4
-rw-r--r--host/include/uhd/utils/gain_group.hpp11
6 files changed, 28 insertions, 33 deletions
diff --git a/host/include/uhd/usrp/codec_props.hpp b/host/include/uhd/usrp/codec_props.hpp
index ab09b1703..c3aba143f 100644
--- a/host/include/uhd/usrp/codec_props.hpp
+++ b/host/include/uhd/usrp/codec_props.hpp
@@ -30,8 +30,8 @@ namespace uhd{ namespace usrp{
enum codec_prop_t{
CODEC_PROP_NAME = 'n', //ro, std::string
CODEC_PROP_OTHERS = 'o', //ro, prop_names_t
- CODEC_PROP_GAIN_I = 'i', //rw, float
- CODEC_PROP_GAIN_Q = 'q', //rw, float
+ CODEC_PROP_GAIN_I = 'i', //rw, double
+ CODEC_PROP_GAIN_Q = 'q', //rw, double
CODEC_PROP_GAIN_RANGE = 'r', //ro, gain_range_t
CODEC_PROP_GAIN_NAMES = 'G' //ro, prop_names_t
};
diff --git a/host/include/uhd/usrp/dboard_iface.hpp b/host/include/uhd/usrp/dboard_iface.hpp
index b04756c47..3ac170b52 100644
--- a/host/include/uhd/usrp/dboard_iface.hpp
+++ b/host/include/uhd/usrp/dboard_iface.hpp
@@ -102,7 +102,7 @@ public:
* \param which_dac the dac index 0, 1, 2, 3...
* \param value the value in volts
*/
- virtual void write_aux_dac(unit_t unit, aux_dac_t which_dac, float value) = 0;
+ virtual void write_aux_dac(unit_t unit, aux_dac_t which_dac, double value) = 0;
/*!
* Read from an aux adc.
@@ -111,7 +111,7 @@ public:
* \param which_adc the adc index 0, 1, 2, 3...
* \return the value in volts
*/
- virtual float read_aux_adc(unit_t unit, aux_adc_t which_adc) = 0;
+ virtual double read_aux_adc(unit_t unit, aux_adc_t which_adc) = 0;
/*!
* Set a daughterboard output pin control source.
@@ -191,8 +191,6 @@ public:
*/
virtual boost::uint16_t get_gpio_out(unit_t unit);
- UHD_DEPRECATED void write_gpio(unit_t unit, boost::uint16_t value){set_gpio_out(unit, value);}
-
/*!
* Setup the GPIO debug mux.
*
diff --git a/host/include/uhd/usrp/multi_usrp.hpp b/host/include/uhd/usrp/multi_usrp.hpp
index 1db96a27e..b603d4324 100644
--- a/host/include/uhd/usrp/multi_usrp.hpp
+++ b/host/include/uhd/usrp/multi_usrp.hpp
@@ -257,10 +257,10 @@ public:
* \param name the name of the gain element
* \param chan the channel index 0 to N-1
*/
- virtual void set_rx_gain(float gain, const std::string &name, size_t chan) = 0;
+ virtual void set_rx_gain(double gain, const std::string &name, size_t chan) = 0;
//! A convenience wrapper for setting overall RX gain
- void set_rx_gain(float gain, size_t chan){
+ void set_rx_gain(double gain, size_t chan){
return this->set_rx_gain(gain, ALL_GAINS, chan);
}
@@ -271,10 +271,10 @@ public:
* \param chan the channel index 0 to N-1
* \return the gain in dB
*/
- virtual float get_rx_gain(const std::string &name, size_t chan) = 0;
+ virtual double get_rx_gain(const std::string &name, size_t chan) = 0;
//! A convenience wrapper for getting overall RX gain
- float get_rx_gain(size_t chan){
+ double get_rx_gain(size_t chan){
return this->get_rx_gain(ALL_GAINS, chan);
}
@@ -348,7 +348,7 @@ public:
* \return the rssi in dB
* \throw exception if RSSI readback not supported
*/
- virtual float read_rssi(size_t chan) = 0;
+ virtual double read_rssi(size_t chan) = 0;
/*!
* Get the dboard interface object for the RX subdevice.
@@ -436,10 +436,10 @@ public:
* \param name the name of the gain element
* \param chan the channel index 0 to N-1
*/
- virtual void set_tx_gain(float gain, const std::string &name, size_t chan) = 0;
+ virtual void set_tx_gain(double gain, const std::string &name, size_t chan) = 0;
//! A convenience wrapper for setting overall TX gain
- void set_tx_gain(float gain, size_t chan){
+ void set_tx_gain(double gain, size_t chan){
return this->set_tx_gain(gain, ALL_GAINS, chan);
}
@@ -450,10 +450,10 @@ public:
* \param chan the channel index 0 to N-1
* \return the gain in dB
*/
- virtual float get_tx_gain(const std::string &name, size_t chan) = 0;
+ virtual double get_tx_gain(const std::string &name, size_t chan) = 0;
//! A convenience wrapper for getting overall TX gain
- float get_tx_gain(size_t chan){
+ double get_tx_gain(size_t chan){
return this->get_tx_gain(ALL_GAINS, chan);
}
diff --git a/host/include/uhd/usrp/single_usrp.hpp b/host/include/uhd/usrp/single_usrp.hpp
index bfbb90912..d56b0a47a 100644
--- a/host/include/uhd/usrp/single_usrp.hpp
+++ b/host/include/uhd/usrp/single_usrp.hpp
@@ -190,10 +190,10 @@ public:
* \param name the name of the gain element
* \param chan the channel index 0 to N-1
*/
- virtual void set_rx_gain(float gain, const std::string &name, size_t chan = 0) = 0;
+ virtual void set_rx_gain(double gain, const std::string &name, size_t chan = 0) = 0;
//! A convenience wrapper for setting overall RX gain
- void set_rx_gain(float gain, size_t chan = 0){
+ void set_rx_gain(double gain, size_t chan = 0){
return this->set_rx_gain(gain, ALL_GAINS, chan);
}
@@ -204,10 +204,10 @@ public:
* \param chan the channel index 0 to N-1
* \return the gain in dB
*/
- virtual float get_rx_gain(const std::string &name, size_t chan = 0) = 0;
+ virtual double get_rx_gain(const std::string &name, size_t chan = 0) = 0;
//! A convenience wrapper for getting overall RX gain
- float get_rx_gain(size_t chan = 0){
+ double get_rx_gain(size_t chan = 0){
return this->get_rx_gain(ALL_GAINS, chan);
}
@@ -281,7 +281,7 @@ public:
* \return the rssi in dB
* \throw exception if RSSI readback not supported
*/
- virtual float read_rssi(size_t chan = 0) = 0;
+ virtual double read_rssi(size_t chan = 0) = 0;
/*!
* Get the dboard interface object for the RX subdevice.
@@ -359,10 +359,10 @@ public:
* \param name the name of the gain element
* \param chan the channel index 0 to N-1
*/
- virtual void set_tx_gain(float gain, const std::string &name, size_t chan = 0) = 0;
+ virtual void set_tx_gain(double gain, const std::string &name, size_t chan = 0) = 0;
//! A convenience wrapper for setting overall TX gain
- void set_tx_gain(float gain, size_t chan = 0){
+ void set_tx_gain(double gain, size_t chan = 0){
return this->set_tx_gain(gain, ALL_GAINS, chan);
}
@@ -373,10 +373,10 @@ public:
* \param chan the channel index 0 to N-1
* \return the gain in dB
*/
- virtual float get_tx_gain(const std::string &name, size_t chan = 0) = 0;
+ virtual double get_tx_gain(const std::string &name, size_t chan = 0) = 0;
//! A convenience wrapper for getting overall TX gain
- float get_tx_gain(size_t chan = 0){
+ double get_tx_gain(size_t chan = 0){
return this->get_tx_gain(ALL_GAINS, chan);
}
diff --git a/host/include/uhd/usrp/subdev_props.hpp b/host/include/uhd/usrp/subdev_props.hpp
index 8f096ffe4..fb4b5fc15 100644
--- a/host/include/uhd/usrp/subdev_props.hpp
+++ b/host/include/uhd/usrp/subdev_props.hpp
@@ -44,7 +44,7 @@ namespace uhd{ namespace usrp{
enum subdev_prop_t{
SUBDEV_PROP_NAME = 'n', //ro, std::string
SUBDEV_PROP_OTHERS = 'o', //ro, prop_names_t
- SUBDEV_PROP_GAIN = 'g', //rw, float
+ SUBDEV_PROP_GAIN = 'g', //rw, double
SUBDEV_PROP_GAIN_RANGE = 'r', //ro, gain_range_t
SUBDEV_PROP_GAIN_NAMES = 'G', //ro, prop_names_t
SUBDEV_PROP_FREQ = 'f', //rw, double
@@ -55,7 +55,7 @@ namespace uhd{ namespace usrp{
SUBDEV_PROP_CONNECTION = 'c', //ro, subdev_conn_t
SUBDEV_PROP_ENABLED = 'e', //rw, bool
SUBDEV_PROP_USE_LO_OFFSET = 'l', //ro, bool
- SUBDEV_PROP_RSSI = 'R', //ro, float
+ SUBDEV_PROP_RSSI = 'R', //ro, double
SUBDEV_PROP_BANDWIDTH = 'B' //rw, double
};
diff --git a/host/include/uhd/utils/gain_group.hpp b/host/include/uhd/utils/gain_group.hpp
index 3d22b9118..7ef7bdcf5 100644
--- a/host/include/uhd/utils/gain_group.hpp
+++ b/host/include/uhd/utils/gain_group.hpp
@@ -28,16 +28,13 @@
namespace uhd{
-//! the data type that represents a gain
-typedef double gain_t;
-
/*!
* A set of function to control a gain element.
*/
struct UHD_API gain_fcns_t{
boost::function<gain_range_t(void)> get_range;
- boost::function<gain_t(void)> get_value;
- boost::function<void(gain_t)> set_value;
+ boost::function<double(void)> get_value;
+ boost::function<void(double)> set_value;
};
class UHD_API gain_group : boost::noncopyable{
@@ -59,7 +56,7 @@ public:
* \param name name of the gain element (optional)
* \return a gain value of the element or all elements
*/
- virtual gain_t get_value(const std::string &name = "") = 0;
+ virtual double get_value(const std::string &name = "") = 0;
/*!
* Set the gain value for the gain element specified by name.
@@ -69,7 +66,7 @@ public:
* \param gain the gain to set for the lement or across the group
* \param name name of the gain element (optional)
*/
- virtual void set_value(gain_t gain, const std::string &name = "") = 0;
+ virtual void set_value(double gain, const std::string &name = "") = 0;
/*!
* Get a list of names of registered gain elements.