pub struct FdtNode<'b, 'a: 'b> {
pub name: &'a str,
/* private fields */
}
Expand description
A devicetree node
Fields§
§name: &'a str
Implementations§
Source§impl<'b, 'a: 'b> FdtNode<'b, 'a>
impl<'b, 'a: 'b> FdtNode<'b, 'a>
Sourcepub fn properties(self) -> impl Iterator<Item = NodeProperty<'a>> + 'b
pub fn properties(self) -> impl Iterator<Item = NodeProperty<'a>> + 'b
Returns an iterator over the available properties of the node
Sourcepub fn property(self, name: &str) -> Option<NodeProperty<'a>>
pub fn property(self, name: &str) -> Option<NodeProperty<'a>>
Attempts to find the a property by its name
Sourcepub fn children(self) -> impl Iterator<Item = FdtNode<'b, 'a>>
pub fn children(self) -> impl Iterator<Item = FdtNode<'b, 'a>>
Returns an iterator over the children of the current node
Sourcepub fn reg(self) -> Option<impl Iterator<Item = MemoryRegion> + 'a>
pub fn reg(self) -> Option<impl Iterator<Item = MemoryRegion> + 'a>
reg
property
Important: this method assumes that the value(s) inside the reg
property represent CPU-addressable addresses that are able to fit within
the platform’s pointer size (e.g. #address-cells
and #size-cells
are
less than or equal to 2 for a 64-bit platform). If this is not the case
or you’re unsure of whether this applies to the node, it is recommended
to use the FdtNode::property
method to extract the raw value slice
or use the provided FdtNode::raw_reg
helper method to give you an
iterator over the address and size slices. One example of where this
would return None
for a node is a pci
child node which contains the
PCI address information in the reg
property, of which the address has
an #address-cells
value of 3.
Sourcepub fn raw_reg(self) -> Option<impl Iterator<Item = RawReg<'a>> + 'a>
pub fn raw_reg(self) -> Option<impl Iterator<Item = RawReg<'a>> + 'a>
Convenience method that provides an iterator over the raw bytes for the
address and size values inside of the reg
property
Sourcepub fn compatible(self) -> Option<Compatible<'a>>
pub fn compatible(self) -> Option<Compatible<'a>>
compatible
property
Sourcepub fn cell_sizes(self) -> CellSizes
pub fn cell_sizes(self) -> CellSizes
Cell sizes for child nodes
Sourcepub fn interrupt_parent(self) -> Option<FdtNode<'b, 'a>>
pub fn interrupt_parent(self) -> Option<FdtNode<'b, 'a>>
Searches for the interrupt parent, if the node contains one
Sourcepub fn interrupt_cells(self) -> Option<usize>
pub fn interrupt_cells(self) -> Option<usize>
#interrupt-cells
property
Sourcepub fn interrupts(self) -> Option<impl Iterator<Item = usize> + 'a>
pub fn interrupts(self) -> Option<impl Iterator<Item = usize> + 'a>
interrupts
property