umsel: device args for enabling umsel2 and verbose

This commit is contained in:
Josh Blum
2015-12-21 15:12:23 -08:00
parent 09f323dc3c
commit f385a4355a
3 changed files with 13 additions and 10 deletions

View File

@@ -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)