diff options
author | Josh Blum <josh@joshknows.com> | 2010-03-10 19:33:38 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-03-10 19:33:38 -0800 |
commit | 9c0fb5e15da3c8ccbc1c8537671703411b210fcf (patch) | |
tree | f6a516c76b2db84903a2e2e44b30af7a49997cb1 /host/include | |
parent | 8e9a8464386db03a596e0b88d0714d22723d37d0 (diff) | |
download | uhd-9c0fb5e15da3c8ccbc1c8537671703411b210fcf.tar.gz uhd-9c0fb5e15da3c8ccbc1c8537671703411b210fcf.tar.bz2 uhd-9c0fb5e15da3c8ccbc1c8537671703411b210fcf.zip |
Filled in dboard code for basics and lf type boards.
The dboard is now just a uint16 (dont bother with the enums).
The dboard manager now registers subdevs with a name.
The basic board code uses a static block to register itself.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/simple_device.hpp | 4 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard_base.hpp | 5 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard_id.hpp | 9 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard_manager.hpp | 2 | ||||
-rw-r--r-- | host/include/uhd/utils.hpp | 5 |
5 files changed, 16 insertions, 9 deletions
diff --git a/host/include/uhd/simple_device.hpp b/host/include/uhd/simple_device.hpp index 64ec85a5c..69f13a8b5 100644 --- a/host/include/uhd/simple_device.hpp +++ b/host/include/uhd/simple_device.hpp @@ -70,7 +70,7 @@ public: virtual double get_rx_rate(void) = 0; virtual std::vector<double> get_rx_rates(void) = 0; - virtual tune_result_t set_rx_freq(double target_freq, double lo_offset) = 0; + virtual tune_result_t set_rx_freq(double freq) = 0; virtual double get_rx_freq_min(void) = 0; virtual double get_rx_freq_max(void) = 0; @@ -91,7 +91,7 @@ public: virtual double get_tx_rate(void) = 0; virtual std::vector<double> get_tx_rates(void) = 0; - virtual tune_result_t set_tx_freq(double target_freq, double lo_offset) = 0; + virtual tune_result_t set_tx_freq(double freq) = 0; virtual double get_tx_freq_min(void) = 0; virtual double get_tx_freq_max(void) = 0; diff --git a/host/include/uhd/usrp/dboard_base.hpp b/host/include/uhd/usrp/dboard_base.hpp index b5c0d40ed..9048344ac 100644 --- a/host/include/uhd/usrp/dboard_base.hpp +++ b/host/include/uhd/usrp/dboard_base.hpp @@ -56,9 +56,9 @@ protected: dboard_id_t get_tx_id(void); private: - std::string _subdev_name; + std::string _subdev_name; dboard_interface::sptr _dboard_interface; - dboard_id_t _rx_id, _tx_id; + dboard_id_t _rx_id, _tx_id; }; /*! @@ -71,6 +71,7 @@ public: * Create a new xcvr dboard object, override in subclasses. */ xcvr_dboard_base(ctor_args_t const&); + virtual ~xcvr_dboard_base(void); }; diff --git a/host/include/uhd/usrp/dboard_id.hpp b/host/include/uhd/usrp/dboard_id.hpp index 65e3d5707..34406863d 100644 --- a/host/include/uhd/usrp/dboard_id.hpp +++ b/host/include/uhd/usrp/dboard_id.hpp @@ -16,17 +16,16 @@ // #include <string> +#include <stdint.h> #ifndef INCLUDED_UHD_USRP_DBOARD_ID_HPP #define INCLUDED_UHD_USRP_DBOARD_ID_HPP namespace uhd{ namespace usrp{ -enum dboard_id_t{ - ID_NONE = 0xffff, - ID_BASIC_TX = 0x0000, - ID_BASIC_RX = 0x0001 -}; +typedef uint16_t dboard_id_t; + +static const dboard_id_t ID_NONE = 0xffff; namespace dboard_id{ std::string to_string(const dboard_id_t &id); diff --git a/host/include/uhd/usrp/dboard_manager.hpp b/host/include/uhd/usrp/dboard_manager.hpp index 042947ac4..cf69675fc 100644 --- a/host/include/uhd/usrp/dboard_manager.hpp +++ b/host/include/uhd/usrp/dboard_manager.hpp @@ -44,11 +44,13 @@ public: * * \param dboard_id the dboard id (rx or tx) * \param dboard_ctor the dboard constructor function pointer + * \param name the canonical name for the dboard represented * \param subdev_names the names of the subdevs on this dboard */ static void register_subdevs( dboard_id_t dboard_id, dboard_ctor_t dboard_ctor, + const std::string &name, const prop_names_t &subdev_names ); diff --git a/host/include/uhd/utils.hpp b/host/include/uhd/utils.hpp index 25a7b5abd..e4cfd098b 100644 --- a/host/include/uhd/utils.hpp +++ b/host/include/uhd/utils.hpp @@ -24,6 +24,11 @@ #include <boost/current_function.hpp> /*! + * Defines a static code block that will be called before main() + */ +#define STATIC_BLOCK(_name, _code) struct _name{_name(void){_code}} _name + +/*! * Useful templated functions and classes that I like to pretend are part of stl */ namespace std{ |