SoDaRadio-5.0.3-master:8901fb5
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SoDa::USRPTuner Class Referenceabstract

Generic class for TX and RX tuning. More...

#include <USRPTuner.hxx>

Inheritance diagram for SoDa::USRPTuner:
SoDa::Debug SoDa::IntNTuner SoDa::SimpleTuner

Public Member Functions

 USRPTuner (uhd::usrp::multi_usrp::sptr usrp, double min_separation, std::string unit_name=std::string("USRPTuner"))
 Constructor –. More...
 
USRPTunermakeTuner (uhd::usrp::multi_usrp::sptr usrp, double min_separation, bool force_fracN=false, bool force_simple=false)
 Factory to build a particular subclass of USRPTuner based on the detected front-end module. More...
 
virtual bool setRXFreq (double rx_freq, double avoid_freq, uhd::tune_result_t &tune_result)=0
 setRXFreq set the RX 1st LO frequency. More...
 
virtual bool setTXFreq (double tx_freq, double avoid_freq, uhd::tune_result_t &tune_result)=0
 setTXFreq set the TX 1st LO frequency. More...
 
- Public Member Functions inherited from SoDa::Debug
 Debug (std::string _unit_name=std::string("UNKNOWN"))
 
 Debug (const char *_unit_name_cstr)
 
 Debug (unsigned int _debug_level, std::string _unit_name=std::string("UNKNOWN"))
 
 Debug (unsigned int _debug_level, const char *_unit_name_cstr)
 
void debugMsg (const std::string &msg, unsigned int threshold=1)
 
void debugMsg (const boost::format &fmt, unsigned int threshold=1)
 
void debugMsg (const char *msg, unsigned int threshold=1)
 
void setDebugLevel (unsigned int v)
 
unsigned int getDebugLevel ()
 

Protected Member Functions

virtual bool checkLock (uhd::tune_request_t &req, char sel, uhd::tune_result_t &cur)
 is the identified (rx or tx) front-end LO locked? If not, set the tuning frequency to "the right thing" More...
 
- Protected Member Functions inherited from SoDa::Debug
std::string curDateTime ()
 

Protected Attributes

double min_separation
 
uhd::usrp::multi_usrp::sptr usrp
 
bool has_lock_detect
 
- Protected Attributes inherited from SoDa::Debug
std::string unit_name
 the name of the unit reporting status More...
 
unsigned int debug_level
 the debug level (threshold) for messages More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SoDa::Debug
static void setDefaultLevel (unsigned int v)
 
static unsigned int getDefaultLevel ()
 
static void setGlobalLevel (unsigned int v)
 
static unsigned int getGlobalLevel ()
 
- Static Public Attributes inherited from SoDa::Debug
static boost::mutex debug_msg_mutex
 
- Static Protected Attributes inherited from SoDa::Debug
static unsigned int default_debug_level = 0
 
static unsigned int global_debug_level = 0
 

Detailed Description

Generic class for TX and RX tuning.

This is specialized for each of the daughtercard modules that needs specialization. The base class implements the standard tuning interface (typically fractional-N).

Definition at line 62 of file USRPTuner.hxx.

Constructor & Destructor Documentation

◆ USRPTuner()

SoDa::USRPTuner::USRPTuner ( uhd::usrp::multi_usrp::sptr  usrp,
double  min_separation,
std::string  unit_name = std::string("USRPTuner") 
)

Constructor –.

Parameters
unit_namethe name of this tuner
usrpa pointer to the USRP object that owns this tuner
min_separationwhere possible, the LO frequency should be at least min_separation Hz from a specified "avoid_frequency."

do nothing here, just remember our separation spec.

Definition at line 57 of file USRPTuner.cxx.

References has_lock_detect, min_separation, and usrp.

Member Function Documentation

◆ checkLock()

bool SoDa::USRPTuner::checkLock ( uhd::tune_request_t &  req,
char  sel,
uhd::tune_result_t &  cur 
)
protectedvirtual

is the identified (rx or tx) front-end LO locked? If not, set the tuning frequency to "the right thing"

Parameters
reqthe requested frequency (and tuning discipline)
sel'r' for RX LO, 't' for TX LO
curtuning result, if the LO was locked.
Returns
true if the LO is locked, false otherwise.

Definition at line 121 of file USRPTuner.cxx.

References SoDa::Debug::debugMsg(), has_lock_detect, and usrp.

Referenced by SoDa::IntNTuner::setRXFreq(), and SoDa::IntNTuner::setTXFreq().

◆ makeTuner()

USRPTuner* SoDa::USRPTuner::makeTuner ( uhd::usrp::multi_usrp::sptr  usrp,
double  min_separation,
bool  force_fracN = false,
bool  force_simple = false 
)

Factory to build a particular subclass of USRPTuner based on the detected front-end module.

Parameters
usrpa pointer to the USRP object that owns this tuner
min_separationwhere possible, the LO frequency should be at least min_separation Hz from a specified "avoid_frequency."
force_fracNif true, turn off intN tuning mode even if it supported,
force_simpleif true, use the simplest version of the tuner.

◆ setRXFreq()

virtual bool SoDa::USRPTuner::setRXFreq ( double  rx_freq,
double  avoid_freq,
uhd::tune_result_t &  tune_result 
)
pure virtual

setRXFreq set the RX 1st LO frequency.

Where possible, the chosen frequency should be separated from the avoid_freq by the amount specified when we created this tuning object.

Parameters
rx_freqthe target frequency of interest
avoid_freqthe frequency that we must avoid by at least min_sep
tune_resultthe response from the UHD set_xx_freq request
Returns
true on success, false on failure.

Implemented in SoDa::SimpleTuner, and SoDa::IntNTuner.

Referenced by SoDa::IntNTuner::IntNTuner().

◆ setTXFreq()

virtual bool SoDa::USRPTuner::setTXFreq ( double  tx_freq,
double  avoid_freq,
uhd::tune_result_t &  tune_result 
)
pure virtual

setTXFreq set the TX 1st LO frequency.

Where possible, the chosen frequency should be separated from the avoid_freq by the amount specified when we created this tuning object.

Parameters
tx_freqthe target frequency of interest
avoid_freqthe frequency that we must avoid by at least min_sep
tune_resultthe response from the UHD set_xx_freq request
Returns
true on success, false on failure.

Implemented in SoDa::SimpleTuner, and SoDa::IntNTuner.

Referenced by SoDa::IntNTuner::IntNTuner().

Member Data Documentation

◆ has_lock_detect

bool SoDa::USRPTuner::has_lock_detect
protected

Definition at line 120 of file USRPTuner.hxx.

Referenced by checkLock(), and USRPTuner().

◆ min_separation

double SoDa::USRPTuner::min_separation
protected

Definition at line 118 of file USRPTuner.hxx.

Referenced by USRPTuner().

◆ usrp

uhd::usrp::multi_usrp::sptr SoDa::USRPTuner::usrp
protected

The documentation for this class was generated from the following files: