47#include <uhd/version.hpp>
48#include <uhd/utils/thread.hpp>
50#include <uhd/utils/safe_main.hpp>
51#include <uhd/usrp/multi_usrp.hpp>
52#include <uhd/usrp/dboard_base.hpp>
53#include <uhd/types/tune_request.hpp>
54#include <uhd/types/tune_result.hpp>
56#include <SoDa/MailBox.hxx>
86 ret->registerThread(ret);
208 void setTXEna(
bool enable,
bool full_duplex)
override {
230 uhd::tune_result_t & cur);
266 uhd::usrp::multi_usrp::sptr
usrp;
356 uhd::tune_request_t * tune_req);
Thread class that provides the common radio functions for any compatible radio.
The Baseclass for all SoDa objects, and useful commonly used classes.
The Baseclass for all SoDa thread objects.
ClockSource
some radios support two sources for the master oscillator reference.
Though libuhd is designed to be re-entrant, there are some indications that all control functions (se...
Though libuhd is designed to be re-entrant, there are some indications that all control functions (se...
bool isLOLocked(SoDa::RXTX rxtx)
is the identified (rx or tx) front-end LO locked?
double first_gettime
timestamps are relative to the first timestamp.
void initControlGPIO()
Initialize the GPIO control registers to set the direction and enables for the TX/RX relay output and...
double last_rx_req_freq
remember the last setting – useful for "calibration check"
Command::ClockSource getClockSource()
Some radios support multiple choices for the main reference clock source.
uhd::tune_result_t saved_rx_tune_result
previous RX tune result – used for transverter LO "calibration" function
uhd::tune_result_t last_rx_tune_result
RX tune result – actual LO and DSP freq.
bool supports_IntN_Mode
if true, this unit can tune the front-end LO
static USRPCtrlPtr make(ParamsPtr params)
float getSampleRate(SoDa::RXTX rxtx)
Get the current setting for the sample rate.
SoDa::USRPPropTree * tx_fe_subtree
property tree from daughtercard module
uhd::usrp::dboard_iface::sptr dboard
the daughterboard we're controlling
double tx_samp_rate
sample rate to USRP TX chain.
void setSampleRate(float rate, SoDa::RXTX rxtx)
Set the RX or TX sample rate.
RadioControlPtr getSelfPtr()
get a pointer to myself (for things like exception handlers.)
double tx_freq
remember current tx freq
static const unsigned int TX_RELAY_CTL
we use TX_IO bit 12 to turn on the TX relay we use TX_IO bit 11 to monitor the TX relay
bool getTXRelayOn()
get the state of the TX relay confirm bit
bool tx_on
if true, we are transmitting.
std::weak_ptr< USRPCtrl > self
SoDa::USRPPropTree * rx_fe_subtree
property tree from daughtercard module
double getLOFreq(SoDa::RXTX rxtx)
Return the current LO (front end) oscillator setting for RX or TX chain.
uhd::tune_result_t last_tx_tune_result
TX tune result.
SoDa::USRPTRControl * tr_control
external control widget for TR switching and other things.
void testIntNMode(bool force_int_N, bool force_frac_N)
Test for support for integer-N synthesis.
void applyTargetFreqCorrection(double target_freq, double avoid_freq, uhd::tune_request_t *tune_req)
applyTargetFreqCorrection adjusts the requested frequency, if necessary, to avoid a birdie caused by ...
double rx_rf_gain
rf gain for RX front end amp/attenuator
uhd::freq_range_t tx_rf_freq_range
property of the device – what is the min/maximum TX frequency?
bool debug_mode
print stuff when we are in debug mode
double tx_freq_rxmode_offset
when in RX mode, move tx off frequency to put the tx birdie out of band, when in TX mode,...
bool getTXEna()
get the state of the TXEna bit
static const unsigned int TX_RELAY_MON
mask for RELAY sense bit
bool setClockSource(Command::ClockSource src)
Some radios support multiple choices for the main reference clock source.
void setAntenna(const std::string &ant, SoDa::RXTX rxtx)
Set the antenna choice.
uhd::usrp::multi_usrp::sptr usrp
to which USRP unit is this connected?
uhd::gain_range_t rx_rf_gain_range
property of the device – what is the min/maximum RX gain setting?
std::string getHardwareDescription()
report the model number and any other interesting features (like freq range) to be displayed on the U...
uhd::usrp::multi_usrp::sptr getUSRP()
return a pointer to the multi_usrp object – used by RX and TX processes to find the associated USRP w...
uhd::freq_range_t rx_rf_freq_range
property of the device – what is the min/maximum RX frequency?
bool is_B210
the B210 has two tx channels – use the second for a Transverter LO – see USRPLO
std::string motherboard_name
The model name of the USRP unit.
std::vector< std::string > listAntennas(SoDa::RXTX rxtx)
report the antennas that are available.
static const double rxmode_offset
tx offset when in RX mode
void setTXEna(bool enable, bool full_duplex) override
Enable or disable the transmit hardware chain, including the antenna relay and PA enable.
std::string getAntenna(SoDa::RXTX rxtx)
Get the current selected antenna.
uhd::tune_result_t checkLock(uhd::tune_request_t &req, char sel, uhd::tune_result_t &cur)
is the identified (rx or tx) front-end LO locked?
bool tx_has_lo_locked_sensor
does the tx frond end have an lo_locked sensor?
bool is_B2xx
The B200 and B210 need some special handling, as they don't have frontend lock indications (as of 3....
bool rx_fe_has_enable
can we access rx_fe_subtree/enabled ?
void locSetTXEna(bool val)
hardware-level TX relay and front-end control
uhd::gain_range_t tx_rf_gain_range
property of the device – what is the min/maximum TX gain setting?
double tx_rf_gain
rf gain for final TX amp
std::string tx_ant
TX antenna choice (usually has to be TX or TX/RX1?
void setTXFrontEndEnable(bool val)
set TX enable property on front-end module – not present in all daughtercards...
bool tx_fe_has_enable
can we access tx_fe_subtree/enabled ?
bool supports_tx_gpio
does this unit support GPIO signals? (B2xx does not as of 3.7.0)
bool rx_has_lo_locked_sensor
does the rx frond end have an lo_locked sensor?
double setLOFreq(double freq, SoDa::RXTX rxtx)
Set the front-end (LO + DDS) frequency to 'freq' This includes setting the PLL front end synthesizer ...
float setRFGain(float gain, SoDa::RXTX rxtx)
set tain on the RX or TX side
USRPCtrl(ParamsPtr params)
Constructor Build a USRPCtrl thread.
USRPPropTree class encapsulates the USRP property tree functions to allow better trap and error recov...
Generic Control class to activate T/R switching, band switching, and other control functions.
std::shared_ptr< RadioControl > RadioControlPtr
RXTX
We often need to distinguis between the RX and TX device.
std::shared_ptr< Params > ParamsPtr
std::shared_ptr< USRPCtrl > USRPCtrlPtr