mirror of
https://github.com/fairwaves/UHD-Fairwaves.git
synced 2025-11-03 13:33:15 +00:00
umsel: device args for enabling umsel2 and verbose
This commit is contained in:
@@ -22,8 +22,6 @@
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
|
||||
static const bool verbose = true;
|
||||
|
||||
static const int REG0_NVALUE_SHIFT = 4;
|
||||
static const int REG0_NVALUE_MASK = 0xffff;
|
||||
static const int REG0_PRESCALER_SHIFT = 20;
|
||||
@@ -108,8 +106,8 @@ class umsel2_ctrl_impl : public umsel2_ctrl
|
||||
{
|
||||
public:
|
||||
|
||||
umsel2_ctrl_impl(uhd::wb_iface::sptr ctrl, uhd::spi_iface::sptr spiface, const double ref_clock):
|
||||
_ctrl(ctrl), _spiface(spiface), _ref_clock(ref_clock)
|
||||
umsel2_ctrl_impl(uhd::wb_iface::sptr ctrl, uhd::spi_iface::sptr spiface, const double ref_clock, const bool verbose):
|
||||
_ctrl(ctrl), _spiface(spiface), _ref_clock(ref_clock), verbose(verbose)
|
||||
{
|
||||
this->init_synth(SPI_SS_AUX1);
|
||||
this->init_synth(SPI_SS_AUX2);
|
||||
@@ -471,9 +469,10 @@ private:
|
||||
uhd::spi_iface::sptr _spiface;
|
||||
const double _ref_clock;
|
||||
std::map<int, std::map<int, int> > _regs;
|
||||
const bool verbose;
|
||||
};
|
||||
|
||||
umsel2_ctrl::sptr umsel2_ctrl::make(uhd::wb_iface::sptr ctrl, uhd::spi_iface::sptr spiface, const double ref_clock)
|
||||
umsel2_ctrl::sptr umsel2_ctrl::make(uhd::wb_iface::sptr ctrl, uhd::spi_iface::sptr spiface, const double ref_clock, const bool verbose)
|
||||
{
|
||||
return umsel2_ctrl::sptr(new umsel2_ctrl_impl(ctrl, spiface, ref_clock));
|
||||
return umsel2_ctrl::sptr(new umsel2_ctrl_impl(ctrl, spiface, ref_clock, verbose));
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class umsel2_ctrl
|
||||
public:
|
||||
typedef boost::shared_ptr<umsel2_ctrl> sptr;
|
||||
|
||||
static sptr make(uhd::wb_iface::sptr ctrl, uhd::spi_iface::sptr spiface, const double ref_clock);
|
||||
static sptr make(uhd::wb_iface::sptr ctrl, uhd::spi_iface::sptr spiface, const double ref_clock, const bool verbose);
|
||||
|
||||
/*!
|
||||
* Query the tune range.
|
||||
|
||||
@@ -273,9 +273,13 @@ umtrx_impl::umtrx_impl(const device_addr_t &device_addr)
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// setup umsel2 control when present
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//TODO delect umsel2 and setup _umsel2 sptr...
|
||||
//will be null when not available
|
||||
_umsel2 = umsel2_ctrl::make(_ctrl/*peek*/, _ctrl/*spi*/, this->get_master_clock_rate());
|
||||
const std::string detect_umsel = device_addr.get("umsel", "off");
|
||||
if (detect_umsel != "off")
|
||||
{
|
||||
//TODO delect umsel2 automatically with I2C communication
|
||||
const bool umsel_verbose = device_addr.has_key("umsel_verbose");
|
||||
_umsel2 = umsel2_ctrl::make(_ctrl/*peek*/, _ctrl/*spi*/, this->get_master_clock_rate(), umsel_verbose);
|
||||
}
|
||||
|
||||
//register lock detect for umsel2
|
||||
if (_umsel2)
|
||||
|
||||
Reference in New Issue
Block a user