diff options
Diffstat (limited to 'host/lib/ic_reg_maps')
-rwxr-xr-x | host/lib/ic_reg_maps/common.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/host/lib/ic_reg_maps/common.py b/host/lib/ic_reg_maps/common.py index 59a24d298..a689872ff 100755 --- a/host/lib/ic_reg_maps/common.py +++ b/host/lib/ic_reg_maps/common.py @@ -65,6 +65,22 @@ public: % endfor } + % for reg in regs: + % if reg.is_array: + std::vector<${reg.get_type()}> get_state_${reg.get_name()}(void){ + if (_state == NULL) throw uhd::runtime_error("no saved state"); + return _state->${reg.get_name()}; + } + + % else: + ${reg.get_type()} get_state_${reg.get_name()}(void){ + if (_state == NULL) throw uhd::runtime_error("no saved state"); + return _state->${reg.get_name()}; + } + + % endif + % endfor + template<typename T> std::set<T> get_changed_addrs(void){ if (_state == NULL) throw uhd::runtime_error("no saved state"); //check each register for changes @@ -163,6 +179,14 @@ class ${name}_t: % endif % endfor + % for reg in regs: + def get_state_${reg.get_name()}(self): + if self._state is None: + raise RuntimeError("No saved state") + return self._state.${reg.get_name()} + + %endfor + def get_changed_addrs(self): if self._state is None: raise RuntimeError("No saved state") |