edtlib: move Register
This is just moving the class definition higher in the file to make it easier to type annotate the module. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
20731a3cab
commit
da31368eed
1 changed files with 33 additions and 32 deletions
|
@ -698,6 +698,39 @@ class Property:
|
|||
return "<Property, {}>".format(", ".join(fields))
|
||||
|
||||
|
||||
class Register:
|
||||
"""
|
||||
Represents a register on a node.
|
||||
|
||||
These attributes are available on Register objects:
|
||||
|
||||
node:
|
||||
The Node instance this register is from
|
||||
|
||||
name:
|
||||
The name of the register as given in the 'reg-names' property, or None if
|
||||
there is no 'reg-names' property
|
||||
|
||||
addr:
|
||||
The starting address of the register, in the parent address space, or None
|
||||
if #address-cells is zero. Any 'ranges' properties are taken into account.
|
||||
|
||||
size:
|
||||
The length of the register in bytes
|
||||
"""
|
||||
def __repr__(self):
|
||||
fields = []
|
||||
|
||||
if self.name is not None:
|
||||
fields.append("name: " + self.name)
|
||||
if self.addr is not None:
|
||||
fields.append("addr: " + hex(self.addr))
|
||||
if self.size is not None:
|
||||
fields.append("size: " + hex(self.size))
|
||||
|
||||
return "<Register, {}>".format(", ".join(fields))
|
||||
|
||||
|
||||
class EDT:
|
||||
"""
|
||||
Represents a devicetree augmented with information from bindings.
|
||||
|
@ -2136,38 +2169,6 @@ class Range:
|
|||
|
||||
return "<Range, {}>".format(", ".join(fields))
|
||||
|
||||
class Register:
|
||||
"""
|
||||
Represents a register on a node.
|
||||
|
||||
These attributes are available on Register objects:
|
||||
|
||||
node:
|
||||
The Node instance this register is from
|
||||
|
||||
name:
|
||||
The name of the register as given in the 'reg-names' property, or None if
|
||||
there is no 'reg-names' property
|
||||
|
||||
addr:
|
||||
The starting address of the register, in the parent address space, or None
|
||||
if #address-cells is zero. Any 'ranges' properties are taken into account.
|
||||
|
||||
size:
|
||||
The length of the register in bytes
|
||||
"""
|
||||
def __repr__(self):
|
||||
fields = []
|
||||
|
||||
if self.name is not None:
|
||||
fields.append("name: " + self.name)
|
||||
if self.addr is not None:
|
||||
fields.append("addr: " + hex(self.addr))
|
||||
if self.size is not None:
|
||||
fields.append("size: " + hex(self.size))
|
||||
|
||||
return "<Register, {}>".format(", ".join(fields))
|
||||
|
||||
|
||||
class ControllerAndData:
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue