From 9fb6b67f29d479da2c78814e8e3c90b0a192b508 Mon Sep 17 00:00:00 2001 From: Lars Amsel Date: Thu, 7 Apr 2022 18:32:22 +0200 Subject: uhd: change default into option flag in register definition This adds support for read only registers in generated interfaces. For this the default is extended to an option string. The old format is still supported for backward compability, so if options string is just a number it will be handled as a writable number. The option string is a comma separated list with key=value pairs. The value is optional and treated as None if missing. common.py now allows to pass in **kwargs to the generate method which is used by gen_zbx_cpld_regs.py to pass a filter function for registers used by mpm only. get_all_addr now has an additional (optional, defaults to false) flag to indicate whether read only addresses are to be returned or not. It also supports type generic for the result to align with get_changed_addr function. The ZBX CPLD CTRL map is adapted accordingly to reflect read only registers. The power registers are flagged as MPM scope only (and not used in ZBX CPLD control of UHD). Co-authored-by: Martin Braun --- host/lib/usrp/dboard/zbx/zbx_cpld_ctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/dboard/zbx/zbx_cpld_ctrl.cpp b/host/lib/usrp/dboard/zbx/zbx_cpld_ctrl.cpp index 352a7def9..28a7c6347 100644 --- a/host/lib/usrp/dboard/zbx/zbx_cpld_ctrl.cpp +++ b/host/lib/usrp/dboard/zbx/zbx_cpld_ctrl.cpp @@ -900,7 +900,7 @@ void zbx_cpld_ctrl::commit(const chan_t chan, const bool save_all) UHD_LOG_TRACE(_log_id, "Storing register cache " << (save_all ? "completely" : "selectively") << " to CPLD..."); - const auto changed_addrs = save_all ? _regs.get_all_addrs() + const auto changed_addrs = save_all ? _regs.get_all_addrs() : _regs.get_changed_addrs(); for (const auto addr : changed_addrs) { _poke32(addr, _regs.get_reg(addr), save_all ? NO_CHAN : chan); -- cgit v1.2.3