class ReferenceProperty
Defined at line 130 of file ../../sdk/lib/driver/devicetree/visitors/property-parser.h
Represents a property that contains one or more references to other devicetree nodes (phandles),
each potentially followed by a set of arguments (cells).
For example: `gpios =
<
&gpio
1 1 2>,
<
&gpio
2 3 4 0>;`
This property contains two references: one to `gpio1` with cells `{1, 2}` and one to `gpio2` with
cells `{3, 4, 0}`.
Public Methods
zx::result<> Parse (Node & node, std::map<PropertyName, std::any> & values)
Defined at line 99 of file ../../sdk/lib/driver/devicetree/visitors/property-parser.cc
void ReferenceProperty (PropertyName name, std::variant<PropertyName, uint32_t> cell_specifier, bool required)
Constructs a `ReferenceProperty` parser.
The `cell_specifier` determines how many cells (u32 values) follow each phandle in the
property. It can be either:
1. A `PropertyName` (e.g., "#interrupt-cells"): The number of cells is determined by reading
the value of that property from the referenced node. This is the most common case.
Example:
intc: interrupt-controller
.
.. {
#interrupt-cells =
<
2>;
};
my_device: my_device
.
.. {
interrupts =
<
&intc
1 8>; // Parsed using `ReferenceProperty("interrupts",
// "#interrupt-cells")`.
};
2. A `uint32_t`: A fixed number of cells that applies to all references within this property.
Example:
my_device: my_device
.
.. {
mboxes =
<
&mbox
0>,
<
&mbox
1>; // Parsed using `ReferenceProperty("mboxes", 1)`.
};
Defined at line 155 of file ../../sdk/lib/driver/devicetree/visitors/property-parser.h