pub struct Memory<'a> { /* private fields */ }Expand description
Memory node describing physical memory layout.
This node type represents memory nodes in the device tree, which describe
the physical memory layout available to the system. The reg property
contains one or more memory regions.
Implementations§
Source§impl<'a> Memory<'a>
impl<'a> Memory<'a>
Sourcepub fn regions(&self) -> impl Iterator<Item = MemoryRegion> + 'a
pub fn regions(&self) -> impl Iterator<Item = MemoryRegion> + 'a
Returns an iterator over memory regions.
The reg property of a memory node describes the physical memory
layout, with each entry specifying a base address and size.
Sourcepub fn regions_array<const N: usize>(&self) -> Vec<MemoryRegion, N>
pub fn regions_array<const N: usize>(&self) -> Vec<MemoryRegion, N>
Returns all memory regions as a fixed-size array.
This is useful for no_std environments where heap allocation is not
available. Returns a heapless::Vec with at most N entries.
Sourcepub fn total_size(&self) -> u64
pub fn total_size(&self) -> u64
Returns the total memory size across all regions.
Methods from Deref<Target = NodeBase<'a>>§
Sourcepub fn properties(&self) -> PropIter<'a> ⓘ
pub fn properties(&self) -> PropIter<'a> ⓘ
Returns an iterator over this node’s properties.
Sourcepub fn find_property(&self, name: &str) -> Option<Property<'a>>
pub fn find_property(&self, name: &str) -> Option<Property<'a>>
Finds a property by name.
Sourcepub fn find_property_str(&self, name: &str) -> Option<&'a str>
pub fn find_property_str(&self, name: &str) -> Option<&'a str>
Finds a string property by name.
Sourcepub fn reg(&self) -> Option<RegIter<'a>>
pub fn reg(&self) -> Option<RegIter<'a>>
Finds and parses the reg property, returning a Reg iterator.
Sourcepub fn reg_array<const N: usize>(&self) -> Vec<RegInfo, N>
pub fn reg_array<const N: usize>(&self) -> Vec<RegInfo, N>
Finds and parses the reg property, returning all RegInfo entries.
Sourcepub fn compatibles(&self) -> impl Iterator<Item = &'a str>
pub fn compatibles(&self) -> impl Iterator<Item = &'a str>
Returns an iterator over compatible strings.