mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 22:53:04 +00:00
m1n1.utils: Add Register32.fields property
Signed-off-by: Martin Povišer <povik@protonmail.com>
This commit is contained in:
parent
d65526d326
commit
145b1101c9
1 changed files with 4 additions and 0 deletions
|
@ -234,6 +234,10 @@ class Register(Reloadable, metaclass=RegisterMeta):
|
|||
|
||||
return val
|
||||
|
||||
@property
|
||||
def fields(self):
|
||||
return {k: getattr(self, k) for k in self._fields_list}
|
||||
|
||||
def str_fields(self):
|
||||
return f"{', '.join(f'{k}={self._field_val(k)}' for k in self._fields_list)}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue