Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
Devicetree main header. More...
#include <zephyr/devicetree_generated.h>
#include <zephyr/irq_multilevel.h>
#include <zephyr/sys/util.h>
#include <zephyr/devicetree/io-channels.h>
#include <zephyr/devicetree/clocks.h>
#include <zephyr/devicetree/gpio.h>
#include <zephyr/devicetree/spi.h>
#include <zephyr/devicetree/dma.h>
#include <zephyr/devicetree/pwms.h>
#include <zephyr/devicetree/fixed-partitions.h>
#include <zephyr/devicetree/ordinals.h>
#include <zephyr/devicetree/pinctrl.h>
#include <zephyr/devicetree/can.h>
#include <zephyr/devicetree/reset.h>
#include <zephyr/devicetree/mbox.h>
Go to the source code of this file.
Macros | |
#define | DT_INVALID_NODE _ |
Name for an invalid node identifier. | |
#define | DT_ROOT DT_N |
Node identifier for the root node in the devicetree. | |
#define | DT_PATH(...) DT_PATH_INTERNAL(__VA_ARGS__) |
Get a node identifier for a devicetree path. | |
#define | DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label) |
Get a node identifier for a node label. | |
#define | DT_ALIAS(alias) DT_CAT(DT_N_ALIAS_, alias) |
Get a node identifier from /aliases. | |
#define | DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat)) |
Get a node identifier for an instance of a compatible. | |
#define | DT_PARENT(node_id) DT_CAT(node_id, _PARENT) |
Get a node identifier for a parent node. | |
#define | DT_GPARENT(node_id) DT_PARENT(DT_PARENT(node_id)) |
Get a node identifier for a grandparent node. | |
#define | DT_CHILD(node_id, child) UTIL_CAT(node_id, DT_S_PREFIX(child)) |
Get a node identifier for a child node. | |
#define | DT_COMPAT_GET_ANY_STATUS_OKAY(compat) |
Get a node identifier for a status okay node with a compatible. | |
#define | DT_NODE_PATH(node_id) DT_CAT(node_id, _PATH) |
Get a devicetree node's full path as a string literal. | |
#define | DT_NODE_FULL_NAME(node_id) DT_CAT(node_id, _FULL_NAME) |
Get a devicetree node's name with unit-address as a string literal. | |
#define | DT_NODE_CHILD_IDX(node_id) DT_CAT(node_id, _CHILD_IDX) |
Get a devicetree node's index into its parent's list of children. | |
#define | DT_CHILD_NUM(node_id) DT_CAT(node_id, _CHILD_NUM) |
Get the number of child nodes of a given node. | |
#define | DT_CHILD_NUM_STATUS_OKAY(node_id) DT_CAT(node_id, _CHILD_NUM_STATUS_OKAY) |
Get the number of child nodes of a given node which child nodes' status are okay. | |
#define | DT_SAME_NODE(node_id1, node_id2) (DT_DEP_ORD(node_id1) == (DT_DEP_ORD(node_id2))) |
Do node_id1 and node_id2 refer to the same node? | |
#define | DT_NODELABEL_STRING_ARRAY(node_id) { DT_FOREACH_NODELABEL(node_id, DT_NODELABEL_STRING_ARRAY_ENTRY_INTERNAL) } |
Get a devicetree node's node labels as an array of strings. | |
#define | DT_PROP(node_id, prop) DT_CAT3(node_id, _P_, prop) |
Get a devicetree property value. | |
#define | DT_PROP_LEN(node_id, prop) DT_CAT4(node_id, _P_, prop, _LEN) |
Get a property's logical length. | |
#define | DT_PROP_LEN_OR(node_id, prop, default_value) |
Like DT_PROP_LEN(), but with a fallback to default_value . | |
#define | DT_PROP_HAS_IDX(node_id, prop, idx) IS_ENABLED(DT_CAT6(node_id, _P_, prop, _IDX_, idx, _EXISTS)) |
Is index idx valid for an array type property? | |
#define | DT_PROP_HAS_NAME(node_id, prop, name) IS_ENABLED(DT_CAT6(node_id, _P_, prop, _NAME_, name, _EXISTS)) |
Is name name available in a foo-names property? | |
#define | DT_PROP_BY_IDX(node_id, prop, idx) DT_CAT5(node_id, _P_, prop, _IDX_, idx) |
Get the value at index idx in an array type property. | |
#define | DT_PROP_OR(node_id, prop, default_value) |
Like DT_PROP(), but with a fallback to default_value . | |
#define | DT_ENUM_IDX(node_id, prop) DT_CAT4(node_id, _P_, prop, _ENUM_IDX) |
Get a property value's index into its enumeration values. | |
#define | DT_ENUM_IDX_OR(node_id, prop, default_idx_value) |
Like DT_ENUM_IDX(), but with a fallback to a default enum index. | |
#define | DT_ENUM_HAS_VALUE(node_id, prop, value) IS_ENABLED(DT_CAT6(node_id, _P_, prop, _ENUM_VAL_, value, _EXISTS)) |
Does a node enumeration property have a given value? | |
#define | DT_STRING_TOKEN(node_id, prop) DT_CAT4(node_id, _P_, prop, _STRING_TOKEN) |
Get a string property's value as a token. | |
#define | DT_STRING_TOKEN_OR(node_id, prop, default_value) |
Like DT_STRING_TOKEN(), but with a fallback to default_value . | |
#define | DT_STRING_UPPER_TOKEN(node_id, prop) DT_CAT4(node_id, _P_, prop, _STRING_UPPER_TOKEN) |
Like DT_STRING_TOKEN(), but uppercased. | |
#define | DT_STRING_UPPER_TOKEN_OR(node_id, prop, default_value) |
Like DT_STRING_UPPER_TOKEN(), but with a fallback to default_value . | |
#define | DT_STRING_UNQUOTED(node_id, prop) DT_CAT4(node_id, _P_, prop, _STRING_UNQUOTED) |
Get a string property's value as an unquoted sequence of tokens. | |
#define | DT_STRING_UNQUOTED_OR(node_id, prop, default_value) |
Like DT_STRING_UNQUOTED(), but with a fallback to default_value . | |
#define | DT_STRING_TOKEN_BY_IDX(node_id, prop, idx) DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_TOKEN) |
Get an element out of a string-array property as a token. | |
#define | DT_STRING_UPPER_TOKEN_BY_IDX(node_id, prop, idx) DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UPPER_TOKEN) |
Like DT_STRING_TOKEN_BY_IDX(), but uppercased. | |
#define | DT_STRING_UNQUOTED_BY_IDX(node_id, prop, idx) DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UNQUOTED) |
Get a string array item value as an unquoted sequence of tokens. | |
#define | DT_PROP_BY_PHANDLE_IDX(node_id, phs, idx, prop) DT_PROP(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop) |
Get a property value from a phandle in a property. | |
#define | DT_PROP_BY_PHANDLE_IDX_OR(node_id, phs, idx, prop, default_value) DT_PROP_OR(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop, default_value) |
Like DT_PROP_BY_PHANDLE_IDX(), but with a fallback to default_value . | |
#define | DT_PROP_BY_PHANDLE(node_id, ph, prop) DT_PROP_BY_PHANDLE_IDX(node_id, ph, 0, prop) |
Get a property value from a phandle's node. | |
#define | DT_PHA_BY_IDX(node_id, pha, idx, cell) DT_CAT7(node_id, _P_, pha, _IDX_, idx, _VAL_, cell) |
Get a phandle-array specifier cell value at an index. | |
#define | DT_PHA_BY_IDX_OR(node_id, pha, idx, cell, default_value) DT_PROP_OR(node_id, DT_CAT5(pha, _IDX_, idx, _VAL_, cell), default_value) |
Like DT_PHA_BY_IDX(), but with a fallback to default_value . | |
#define | DT_PHA(node_id, pha, cell) DT_PHA_BY_IDX(node_id, pha, 0, cell) |
Equivalent to DT_PHA_BY_IDX(node_id, pha, 0, cell) | |
#define | DT_PHA_OR(node_id, pha, cell, default_value) DT_PHA_BY_IDX_OR(node_id, pha, 0, cell, default_value) |
Like DT_PHA(), but with a fallback to default_value . | |
#define | DT_PHA_BY_NAME(node_id, pha, name, cell) DT_CAT7(node_id, _P_, pha, _NAME_, name, _VAL_, cell) |
Get a value within a phandle-array specifier by name. | |
#define | DT_PHA_BY_NAME_OR(node_id, pha, name, cell, default_value) DT_PROP_OR(node_id, DT_CAT5(pha, _NAME_, name, _VAL_, cell), default_value) |
Like DT_PHA_BY_NAME(), but with a fallback to default_value . | |
#define | DT_PHANDLE_BY_NAME(node_id, pha, name) DT_CAT6(node_id, _P_, pha, _NAME_, name, _PH) |
Get a phandle's node identifier from a phandle array by name . | |
#define | DT_PHANDLE_BY_IDX(node_id, prop, idx) DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH) |
Get a node identifier for a phandle in a property. | |
#define | DT_PHANDLE(node_id, prop) DT_PHANDLE_BY_IDX(node_id, prop, 0) |
Get a node identifier for a phandle property's value. | |
#define | DT_NUM_RANGES(node_id) DT_CAT(node_id, _RANGES_NUM) |
Get the number of range blocks in the ranges property. | |
#define | DT_RANGES_HAS_IDX(node_id, idx) IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _EXISTS)) |
Is idx a valid range block index? | |
#define | DT_RANGES_HAS_CHILD_BUS_FLAGS_AT_IDX(node_id, idx) IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS_EXISTS)) |
Does a ranges property have child bus flags at index? | |
#define | DT_RANGES_CHILD_BUS_FLAGS_BY_IDX(node_id, idx) DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS) |
Get the ranges property child bus flags at index. | |
#define | DT_RANGES_CHILD_BUS_ADDRESS_BY_IDX(node_id, idx) DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_ADDRESS) |
Get the ranges property child bus address at index. | |
#define | DT_RANGES_PARENT_BUS_ADDRESS_BY_IDX(node_id, idx) DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_PARENT_BUS_ADDRESS) |
Get the ranges property parent bus address at index. | |
#define | DT_RANGES_LENGTH_BY_IDX(node_id, idx) DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_LENGTH) |
Get the ranges property length at index. | |
#define | DT_FOREACH_RANGE(node_id, fn) DT_CAT(node_id, _FOREACH_RANGE)(fn) |
Invokes fn for each entry of node_id ranges property. | |
#define | DT_NODE_VENDOR_BY_IDX(node_id, idx) DT_CAT3(node_id, _COMPAT_VENDOR_IDX_, idx) |
Get the vendor at index idx as a string literal. | |
#define | DT_NODE_VENDOR_HAS_IDX(node_id, idx) IS_ENABLED(DT_CAT4(node_id, _COMPAT_VENDOR_IDX_, idx, _EXISTS)) |
Does a node's compatible property have a vendor at an index? | |
#define | DT_NODE_VENDOR_BY_IDX_OR(node_id, idx, default_value) |
Like DT_NODE_VENDOR_BY_IDX(), but with a fallback to default_value. | |
#define | DT_NODE_VENDOR_OR(node_id, default_value) DT_NODE_VENDOR_BY_IDX_OR(node_id, 0, default_value) |
Get the node's (only) vendor as a string literal. | |
#define | DT_NODE_MODEL_BY_IDX(node_id, idx) DT_CAT3(node_id, _COMPAT_MODEL_IDX_, idx) |
Get the model at index "idx" as a string literal. | |
#define | DT_NODE_MODEL_HAS_IDX(node_id, idx) IS_ENABLED(DT_CAT4(node_id, _COMPAT_MODEL_IDX_, idx, _EXISTS)) |
Does a node's compatible property have a model at an index? | |
#define | DT_NODE_MODEL_BY_IDX_OR(node_id, idx, default_value) |
Like DT_NODE_MODEL_BY_IDX(), but with a fallback to default_value. | |
#define | DT_NODE_MODEL_OR(node_id, default_value) DT_NODE_MODEL_BY_IDX_OR(node_id, 0, default_value) |
Get the node's (only) model as a string literal. | |
#define | DT_NUM_REGS(node_id) DT_CAT(node_id, _REG_NUM) |
Get the number of register blocks in the reg property. | |
#define | DT_REG_HAS_IDX(node_id, idx) IS_ENABLED(DT_CAT4(node_id, _REG_IDX_, idx, _EXISTS)) |
Is idx a valid register block index? | |
#define | DT_REG_HAS_NAME(node_id, name) IS_ENABLED(DT_CAT4(node_id, _REG_NAME_, name, _EXISTS)) |
Is name a valid register block name? | |
#define | DT_REG_ADDR_BY_IDX(node_id, idx) DT_CAT4(node_id, _REG_IDX_, idx, _VAL_ADDRESS) |
Get the base address of the register block at index idx . | |
#define | DT_REG_SIZE_BY_IDX(node_id, idx) DT_CAT4(node_id, _REG_IDX_, idx, _VAL_SIZE) |
Get the size of the register block at index idx . | |
#define | DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0) |
Get a node's (only) register block address. | |
#define | DT_REG_ADDR_U64(node_id) DT_U64_C(DT_REG_ADDR(node_id)) |
64-bit version of DT_REG_ADDR() | |
#define | DT_REG_SIZE(node_id) DT_REG_SIZE_BY_IDX(node_id, 0) |
Get a node's (only) register block size. | |
#define | DT_REG_ADDR_BY_NAME(node_id, name) DT_CAT4(node_id, _REG_NAME_, name, _VAL_ADDRESS) |
Get a register block's base address by name. | |
#define | DT_REG_ADDR_BY_NAME_OR(node_id, name, default_value) |
Like DT_REG_ADDR_BY_NAME(), but with a fallback to default_value . | |
#define | DT_REG_ADDR_BY_NAME_U64(node_id, name) DT_U64_C(DT_REG_ADDR_BY_NAME(node_id, name)) |
64-bit version of DT_REG_ADDR_BY_NAME() | |
#define | DT_REG_SIZE_BY_NAME(node_id, name) DT_CAT4(node_id, _REG_NAME_, name, _VAL_SIZE) |
Get a register block's size by name. | |
#define | DT_REG_SIZE_BY_NAME_OR(node_id, name, default_value) |
Like DT_REG_SIZE_BY_NAME(), but with a fallback to default_value . | |
#define | DT_NUM_IRQS(node_id) DT_CAT(node_id, _IRQ_NUM) |
Get the number of interrupt sources for the node. | |
#define | DT_NUM_NODELABELS(node_id) DT_CAT(node_id, _NODELABEL_NUM) |
Get the number of node labels that a node has. | |
#define | DT_IRQ_LEVEL(node_id) DT_CAT(node_id, _IRQ_LEVEL) |
Get the interrupt level for the node. | |
#define | DT_IRQ_HAS_IDX(node_id, idx) IS_ENABLED(DT_CAT4(node_id, _IRQ_IDX_, idx, _EXISTS)) |
Is idx a valid interrupt index? | |
#define | DT_IRQ_HAS_CELL_AT_IDX(node_id, idx, cell) IS_ENABLED(DT_CAT6(node_id, _IRQ_IDX_, idx, _VAL_, cell, _EXISTS)) |
Does an interrupts property have a named cell specifier at an index? If this returns 1, then DT_IRQ_BY_IDX(node_id, idx, cell) is valid. | |
#define | DT_IRQ_HAS_CELL(node_id, cell) DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell) |
Equivalent to DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell) | |
#define | DT_IRQ_HAS_NAME(node_id, name) IS_ENABLED(DT_CAT4(node_id, _IRQ_NAME_, name, _VAL_irq_EXISTS)) |
Does an interrupts property have a named specifier value at an index? If this returns 1, then DT_IRQ_BY_NAME(node_id, name, cell) is valid. | |
#define | DT_IRQ_BY_IDX(node_id, idx, cell) DT_CAT5(node_id, _IRQ_IDX_, idx, _VAL_, cell) |
Get a value within an interrupt specifier at an index. | |
#define | DT_IRQ_BY_NAME(node_id, name, cell) DT_CAT5(node_id, _IRQ_NAME_, name, _VAL_, cell) |
Get a value within an interrupt specifier by name. | |
#define | DT_IRQ(node_id, cell) DT_IRQ_BY_IDX(node_id, 0, cell) |
Get an interrupt specifier's value Equivalent to DT_IRQ_BY_IDX(node_id, 0, cell). | |
#define | DT_IRQ_INTC_BY_IDX(node_id, idx) DT_CAT4(node_id, _IRQ_IDX_, idx, _CONTROLLER) |
Get an interrupt specifier's interrupt controller by index. | |
#define | DT_IRQ_INTC_BY_NAME(node_id, name) DT_CAT4(node_id, _IRQ_NAME_, name, _CONTROLLER) |
Get an interrupt specifier's interrupt controller by name. | |
#define | DT_IRQ_INTC(node_id) DT_IRQ_INTC_BY_IDX(node_id, 0) |
Get an interrupt specifier's interrupt controller. | |
#define | DT_IRQN_BY_IDX(node_id, idx) |
Get the node's Zephyr interrupt number at index If CONFIG_MULTI_LEVEL_INTERRUPTS is enabled, the interrupt number at index will be multi-level encoded. | |
#define | DT_IRQN(node_id) DT_IRQN_BY_IDX(node_id, 0) |
Get a node's (only) irq number. | |
#define | DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop) |
Get a node identifier for a /chosen node property. | |
#define | DT_HAS_CHOSEN(prop) IS_ENABLED(DT_CAT3(DT_CHOSEN_, prop, _EXISTS)) |
Test if the devicetree has a /chosen node. | |
#define | DT_FOREACH_NODE(fn) DT_FOREACH_HELPER(fn) |
Invokes fn for every node in the tree. | |
#define | DT_FOREACH_NODE_VARGS(fn, ...) DT_FOREACH_VARGS_HELPER(fn, __VA_ARGS__) |
Invokes fn for every node in the tree with multiple arguments. | |
#define | DT_FOREACH_STATUS_OKAY_NODE(fn) DT_FOREACH_OKAY_HELPER(fn) |
Invokes fn for every status okay node in the tree. | |
#define | DT_FOREACH_STATUS_OKAY_NODE_VARGS(fn, ...) DT_FOREACH_OKAY_VARGS_HELPER(fn, __VA_ARGS__) |
Invokes fn for every status okay node in the tree with multiple arguments. | |
#define | DT_FOREACH_CHILD(node_id, fn) DT_CAT(node_id, _FOREACH_CHILD)(fn) |
Invokes fn for each child of node_id . | |
#define | DT_FOREACH_CHILD_SEP(node_id, fn, sep) DT_CAT(node_id, _FOREACH_CHILD_SEP)(fn, sep) |
Invokes fn for each child of node_id with a separator. | |
#define | DT_FOREACH_CHILD_VARGS(node_id, fn, ...) DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__) |
Invokes fn for each child of node_id with multiple arguments. | |
#define | DT_FOREACH_CHILD_SEP_VARGS(node_id, fn, sep, ...) DT_CAT(node_id, _FOREACH_CHILD_SEP_VARGS)(fn, sep, __VA_ARGS__) |
Invokes fn for each child of node_id with separator and multiple arguments. | |
#define | DT_FOREACH_CHILD_STATUS_OKAY(node_id, fn) DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY)(fn) |
Call fn on the child nodes with status okay | |
#define | DT_FOREACH_CHILD_STATUS_OKAY_SEP(node_id, fn, sep) DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP)(fn, sep) |
Call fn on the child nodes with status okay with separator. | |
#define | DT_FOREACH_CHILD_STATUS_OKAY_VARGS(node_id, fn, ...) DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_VARGS)(fn, __VA_ARGS__) |
Call fn on the child nodes with status okay with multiple arguments. | |
#define | DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(node_id, fn, sep, ...) DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP_VARGS)(fn, sep, __VA_ARGS__) |
Call fn on the child nodes with status okay with separator and multiple arguments. | |
#define | DT_FOREACH_PROP_ELEM(node_id, prop, fn) DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM)(fn) |
Invokes fn for each element in the value of property prop . | |
#define | DT_FOREACH_PROP_ELEM_SEP(node_id, prop, fn, sep) DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_SEP)(fn, sep) |
Invokes fn for each element in the value of property prop with separator. | |
#define | DT_FOREACH_PROP_ELEM_VARGS(node_id, prop, fn, ...) DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_VARGS)(fn, __VA_ARGS__) |
Invokes fn for each element in the value of property prop with multiple arguments. | |
#define | DT_FOREACH_PROP_ELEM_SEP_VARGS(node_id, prop, fn, sep, ...) |
Invokes fn for each element in the value of property prop with multiple arguments and a separator. | |
#define | DT_FOREACH_STATUS_OKAY(compat, fn) |
Invokes fn for each status okay node of a compatible. | |
#define | DT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) |
Invokes fn for each status okay node of a compatible with multiple arguments. | |
#define | DT_FOREACH_NODELABEL(node_id, fn) DT_CAT(node_id, _FOREACH_NODELABEL)(fn) |
Invokes fn for each node label of a given node. | |
#define | DT_FOREACH_NODELABEL_VARGS(node_id, fn, ...) DT_CAT(node_id, _FOREACH_NODELABEL_VARGS)(fn, __VA_ARGS__) |
Invokes fn for each node label of a given node with multiple arguments. | |
#define | DT_NODE_EXISTS(node_id) IS_ENABLED(DT_CAT(node_id, _EXISTS)) |
Does a node identifier refer to a node? | |
#define | DT_NODE_HAS_STATUS(node_id, status) DT_NODE_HAS_STATUS_INTERNAL(node_id, status) |
Does a node identifier refer to a node with a status? | |
#define | DT_HAS_COMPAT_STATUS_OKAY(compat) IS_ENABLED(DT_CAT(DT_COMPAT_HAS_OKAY_, compat)) |
Does the devicetree have a status okay node with a compatible? | |
#define | DT_NUM_INST_STATUS_OKAY(compat) |
Get the number of instances of a given compatible with status okay | |
#define | DT_NODE_HAS_COMPAT(node_id, compat) IS_ENABLED(DT_CAT3(node_id, _COMPAT_MATCHES_, compat)) |
Does a devicetree node match a compatible? | |
#define | DT_NODE_HAS_COMPAT_STATUS(node_id, compat, status) UTIL_AND(DT_NODE_HAS_COMPAT(node_id, compat), DT_NODE_HAS_STATUS(node_id, status)) |
Does a devicetree node have a compatible and status? | |
#define | DT_NODE_HAS_PROP(node_id, prop) IS_ENABLED(DT_CAT4(node_id, _P_, prop, _EXISTS)) |
Does a devicetree node have a property? | |
#define | DT_PHA_HAS_CELL_AT_IDX(node_id, pha, idx, cell) |
Does a phandle array have a named cell specifier at an index? | |
#define | DT_PHA_HAS_CELL(node_id, pha, cell) DT_PHA_HAS_CELL_AT_IDX(node_id, pha, 0, cell) |
Equivalent to DT_PHA_HAS_CELL_AT_IDX(node_id, pha, 0, cell) | |
#define | DT_BUS(node_id) DT_CAT(node_id, _BUS) |
Node's bus controller. | |
#define | DT_ON_BUS(node_id, bus) IS_ENABLED(DT_CAT3(node_id, _BUS_, bus)) |
Is a node on a bus of a given type? | |
#define | DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT) |
Node identifier for an instance of a DT_DRV_COMPAT compatible. | |
#define | DT_INST_PARENT(inst) DT_PARENT(DT_DRV_INST(inst)) |
Get a DT_DRV_COMPAT parent's node identifier. | |
#define | DT_INST_GPARENT(inst) DT_GPARENT(DT_DRV_INST(inst)) |
Get a DT_DRV_COMPAT grandparent's node identifier. | |
#define | DT_INST_CHILD(inst, child) DT_CHILD(DT_DRV_INST(inst), child) |
Get a node identifier for a child node of DT_DRV_INST(inst) | |
#define | DT_INST_CHILD_NUM(inst) DT_CHILD_NUM(DT_DRV_INST(inst)) |
Get the number of child nodes of a given node. | |
#define | DT_INST_CHILD_NUM_STATUS_OKAY(inst) DT_CHILD_NUM_STATUS_OKAY(DT_DRV_INST(inst)) |
Get the number of child nodes of a given node. | |
#define | DT_INST_NODELABEL_STRING_ARRAY(inst) DT_NODELABEL_STRING_ARRAY(DT_DRV_INST(inst)) |
Get a string array of DT_DRV_INST(inst)'s node labels. | |
#define | DT_INST_NUM_NODELABELS(inst) DT_NUM_NODELABELS(DT_DRV_INST(inst)) |
Get the number of node labels by instance number. | |
#define | DT_INST_FOREACH_CHILD(inst, fn) DT_FOREACH_CHILD(DT_DRV_INST(inst), fn) |
Call fn on all child nodes of DT_DRV_INST(inst). | |
#define | DT_INST_FOREACH_CHILD_SEP(inst, fn, sep) DT_FOREACH_CHILD_SEP(DT_DRV_INST(inst), fn, sep) |
Call fn on all child nodes of DT_DRV_INST(inst) with a separator. | |
#define | DT_INST_FOREACH_CHILD_VARGS(inst, fn, ...) DT_FOREACH_CHILD_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__) |
Call fn on all child nodes of DT_DRV_INST(inst). | |
#define | DT_INST_FOREACH_CHILD_SEP_VARGS(inst, fn, sep, ...) DT_FOREACH_CHILD_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__) |
Call fn on all child nodes of DT_DRV_INST(inst) with separator. | |
#define | DT_INST_FOREACH_CHILD_STATUS_OKAY(inst, fn) DT_FOREACH_CHILD_STATUS_OKAY(DT_DRV_INST(inst), fn) |
Call fn on all child nodes of DT_DRV_INST(inst) with status okay . | |
#define | DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP(inst, fn, sep) DT_FOREACH_CHILD_STATUS_OKAY_SEP(DT_DRV_INST(inst), fn, sep) |
Call fn on all child nodes of DT_DRV_INST(inst) with status okay and with separator. | |
#define | DT_INST_FOREACH_CHILD_STATUS_OKAY_VARGS(inst, fn, ...) DT_FOREACH_CHILD_STATUS_OKAY_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__) |
Call fn on all child nodes of DT_DRV_INST(inst) with status okay and multiple arguments. | |
#define | DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(inst, fn, sep, ...) DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__) |
Call fn on all child nodes of DT_DRV_INST(inst) with status okay and with separator and multiple arguments. | |
#define | DT_INST_ENUM_IDX(inst, prop) DT_ENUM_IDX(DT_DRV_INST(inst), prop) |
Get a DT_DRV_COMPAT value's index into its enumeration values. | |
#define | DT_INST_ENUM_IDX_OR(inst, prop, default_idx_value) DT_ENUM_IDX_OR(DT_DRV_INST(inst), prop, default_idx_value) |
Like DT_INST_ENUM_IDX(), but with a fallback to a default enum index. | |
#define | DT_INST_ENUM_HAS_VALUE(inst, prop, value) DT_ENUM_HAS_VALUE(DT_DRV_INST(inst), prop, value) |
Does a DT_DRV_COMPAT enumeration property have a given value? | |
#define | DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop) |
Get a DT_DRV_COMPAT instance property. | |
#define | DT_INST_PROP_LEN(inst, prop) DT_PROP_LEN(DT_DRV_INST(inst), prop) |
Get a DT_DRV_COMPAT property length. | |
#define | DT_INST_PROP_HAS_IDX(inst, prop, idx) DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx) |
Is index idx valid for an array type property on a DT_DRV_COMPAT instance? | |
#define | DT_INST_PROP_HAS_NAME(inst, prop, name) DT_PROP_HAS_NAME(DT_DRV_INST(inst), prop, name) |
Is name name available in a foo-names property? | |
#define | DT_INST_PROP_BY_IDX(inst, prop, idx) DT_PROP_BY_IDX(DT_DRV_INST(inst), prop, idx) |
Get a DT_DRV_COMPAT element value in an array property. | |
#define | DT_INST_PROP_OR(inst, prop, default_value) DT_PROP_OR(DT_DRV_INST(inst), prop, default_value) |
Like DT_INST_PROP(), but with a fallback to default_value . | |
#define | DT_INST_PROP_LEN_OR(inst, prop, default_value) DT_PROP_LEN_OR(DT_DRV_INST(inst), prop, default_value) |
Like DT_INST_PROP_LEN(), but with a fallback to default_value . | |
#define | DT_INST_STRING_TOKEN(inst, prop) DT_STRING_TOKEN(DT_DRV_INST(inst), prop) |
Get a DT_DRV_COMPAT instance's string property's value as a token. | |
#define | DT_INST_STRING_UPPER_TOKEN(inst, prop) DT_STRING_UPPER_TOKEN(DT_DRV_INST(inst), prop) |
Like DT_INST_STRING_TOKEN(), but uppercased. | |
#define | DT_INST_STRING_UNQUOTED(inst, prop) DT_STRING_UNQUOTED(DT_DRV_INST(inst), prop) |
Get a DT_DRV_COMPAT instance's string property's value as an unquoted sequence of tokens. | |
#define | DT_INST_STRING_TOKEN_BY_IDX(inst, prop, idx) DT_STRING_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx) |
Get an element out of string-array property as a token. | |
#define | DT_INST_STRING_UPPER_TOKEN_BY_IDX(inst, prop, idx) DT_STRING_UPPER_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx) |
Like DT_INST_STRING_TOKEN_BY_IDX(), but uppercased. | |
#define | DT_INST_STRING_UNQUOTED_BY_IDX(inst, prop, idx) DT_STRING_UNQUOTED_BY_IDX(DT_DRV_INST(inst), prop, idx) |
Get an element out of string-array property as an unquoted sequence of tokens. | |
#define | DT_INST_PROP_BY_PHANDLE(inst, ph, prop) DT_INST_PROP_BY_PHANDLE_IDX(inst, ph, 0, prop) |
Get a DT_DRV_COMPAT instance's property value from a phandle's node. | |
#define | DT_INST_PROP_BY_PHANDLE_IDX(inst, phs, idx, prop) DT_PROP_BY_PHANDLE_IDX(DT_DRV_INST(inst), phs, idx, prop) |
Get a DT_DRV_COMPAT instance's property value from a phandle in a property. | |
#define | DT_INST_PHA_BY_IDX(inst, pha, idx, cell) DT_PHA_BY_IDX(DT_DRV_INST(inst), pha, idx, cell) |
Get a DT_DRV_COMPAT instance's phandle-array specifier value at an index. | |
#define | DT_INST_PHA_BY_IDX_OR(inst, pha, idx, cell, default_value) DT_PHA_BY_IDX_OR(DT_DRV_INST(inst), pha, idx, cell, default_value) |
Like DT_INST_PHA_BY_IDX(), but with a fallback to default_value. | |
#define | DT_INST_PHA(inst, pha, cell) DT_INST_PHA_BY_IDX(inst, pha, 0, cell) |
Get a DT_DRV_COMPAT instance's phandle-array specifier value Equivalent to DT_INST_PHA_BY_IDX(inst, pha, 0, cell) | |
#define | DT_INST_PHA_OR(inst, pha, cell, default_value) DT_INST_PHA_BY_IDX_OR(inst, pha, 0, cell, default_value) |
Like DT_INST_PHA(), but with a fallback to default_value. | |
#define | DT_INST_PHA_BY_NAME(inst, pha, name, cell) DT_PHA_BY_NAME(DT_DRV_INST(inst), pha, name, cell) |
Get a DT_DRV_COMPAT instance's value within a phandle-array specifier by name. | |
#define | DT_INST_PHA_BY_NAME_OR(inst, pha, name, cell, default_value) DT_PHA_BY_NAME_OR(DT_DRV_INST(inst), pha, name, cell, default_value) |
Like DT_INST_PHA_BY_NAME(), but with a fallback to default_value. | |
#define | DT_INST_PHANDLE_BY_NAME(inst, pha, name) DT_PHANDLE_BY_NAME(DT_DRV_INST(inst), pha, name) \ |
Get a DT_DRV_COMPAT instance's phandle node identifier from a phandle array by name. | |
#define | DT_INST_PHANDLE_BY_IDX(inst, prop, idx) DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), prop, idx) |
Get a DT_DRV_COMPAT instance's node identifier for a phandle in a property. | |
#define | DT_INST_PHANDLE(inst, prop) DT_INST_PHANDLE_BY_IDX(inst, prop, 0) |
Get a DT_DRV_COMPAT instance's node identifier for a phandle property's value. | |
#define | DT_INST_REG_HAS_IDX(inst, idx) DT_REG_HAS_IDX(DT_DRV_INST(inst), idx) |
is idx a valid register block index on a DT_DRV_COMPAT instance? | |
#define | DT_INST_REG_HAS_NAME(inst, name) DT_REG_HAS_NAME(DT_DRV_INST(inst), name) |
is name a valid register block name on a DT_DRV_COMPAT instance? | |
#define | DT_INST_REG_ADDR_BY_IDX(inst, idx) DT_REG_ADDR_BY_IDX(DT_DRV_INST(inst), idx) |
Get a DT_DRV_COMPAT instance's idx-th register block's address. | |
#define | DT_INST_REG_SIZE_BY_IDX(inst, idx) DT_REG_SIZE_BY_IDX(DT_DRV_INST(inst), idx) |
Get a DT_DRV_COMPAT instance's idx-th register block's size. | |
#define | DT_INST_REG_ADDR_BY_NAME(inst, name) DT_REG_ADDR_BY_NAME(DT_DRV_INST(inst), name) |
Get a DT_DRV_COMPAT 's register block address by name. | |
#define | DT_INST_REG_ADDR_BY_NAME_OR(inst, name, default_value) DT_REG_ADDR_BY_NAME_OR(DT_DRV_INST(inst), name, default_value) |
Like DT_INST_REG_ADDR_BY_NAME(), but with a fallback to default_value . | |
#define | DT_INST_REG_ADDR_BY_NAME_U64(inst, name) DT_U64_C(DT_INST_REG_ADDR_BY_NAME(inst, name)) |
64-bit version of DT_INST_REG_ADDR_BY_NAME() | |
#define | DT_INST_REG_SIZE_BY_NAME(inst, name) DT_REG_SIZE_BY_NAME(DT_DRV_INST(inst), name) |
Get a DT_DRV_COMPAT 's register block size by name. | |
#define | DT_INST_REG_SIZE_BY_NAME_OR(inst, name, default_value) DT_REG_SIZE_BY_NAME_OR(DT_DRV_INST(inst), name, default_value) |
Like DT_INST_REG_SIZE_BY_NAME(), but with a fallback to default_value . | |
#define | DT_INST_REG_ADDR(inst) DT_INST_REG_ADDR_BY_IDX(inst, 0) |
Get a DT_DRV_COMPAT 's (only) register block address. | |
#define | DT_INST_REG_ADDR_U64(inst) DT_U64_C(DT_INST_REG_ADDR(inst)) |
64-bit version of DT_INST_REG_ADDR() | |
#define | DT_INST_REG_SIZE(inst) DT_INST_REG_SIZE_BY_IDX(inst, 0) |
Get a DT_DRV_COMPAT 's (only) register block size. | |
#define | DT_INST_IRQ_LEVEL(inst) DT_IRQ_LEVEL(DT_DRV_INST(inst)) |
Get a DT_DRV_COMPAT interrupt level. | |
#define | DT_INST_IRQ_BY_IDX(inst, idx, cell) DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell) |
Get a DT_DRV_COMPAT interrupt specifier value at an index. | |
#define | DT_INST_IRQ_INTC_BY_IDX(inst, idx) DT_IRQ_INTC_BY_IDX(DT_DRV_INST(inst), idx) |
Get a DT_DRV_COMPAT interrupt specifier's interrupt controller by index. | |
#define | DT_INST_IRQ_INTC_BY_NAME(inst, name) DT_IRQ_INTC_BY_NAME(DT_DRV_INST(inst), name) |
Get a DT_DRV_COMPAT interrupt specifier's interrupt controller by name. | |
#define | DT_INST_IRQ_INTC(inst) DT_INST_IRQ_INTC_BY_IDX(inst, 0) |
Get a DT_DRV_COMPAT interrupt specifier's interrupt controller. | |
#define | DT_INST_IRQ_BY_NAME(inst, name, cell) DT_IRQ_BY_NAME(DT_DRV_INST(inst), name, cell) |
Get a DT_DRV_COMPAT interrupt specifier value by name. | |
#define | DT_INST_IRQ(inst, cell) DT_INST_IRQ_BY_IDX(inst, 0, cell) |
Get a DT_DRV_COMPAT interrupt specifier's value. | |
#define | DT_INST_IRQN(inst) DT_IRQN(DT_DRV_INST(inst)) |
Get a DT_DRV_COMPAT 's (only) irq number. | |
#define | DT_INST_IRQN_BY_IDX(inst, idx) DT_IRQN_BY_IDX(DT_DRV_INST(inst), idx) |
Get a DT_DRV_COMPAT 's irq number at index. | |
#define | DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst)) |
Get a DT_DRV_COMPAT 's bus node identifier. | |
#define | DT_INST_ON_BUS(inst, bus) DT_ON_BUS(DT_DRV_INST(inst), bus) |
Test if a DT_DRV_COMPAT 's bus type is a given type. | |
#define | DT_INST_STRING_TOKEN_OR(inst, name, default_value) DT_STRING_TOKEN_OR(DT_DRV_INST(inst), name, default_value) |
Like DT_INST_STRING_TOKEN(), but with a fallback to default_value . | |
#define | DT_INST_STRING_UPPER_TOKEN_OR(inst, name, default_value) DT_STRING_UPPER_TOKEN_OR(DT_DRV_INST(inst), name, default_value) |
Like DT_INST_STRING_UPPER_TOKEN(), but with a fallback to default_value . | |
#define | DT_INST_STRING_UNQUOTED_OR(inst, name, default_value) DT_STRING_UNQUOTED_OR(DT_DRV_INST(inst), name, default_value) |
Like DT_INST_STRING_UNQUOTED(), but with a fallback to default_value . | |
#define | DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(compat, bus) IS_ENABLED(DT_CAT4(DT_COMPAT_, compat, _BUS_, bus)) |
#define | DT_ANY_INST_ON_BUS_STATUS_OKAY(bus) DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(DT_DRV_COMPAT, bus) |
Test if any DT_DRV_COMPAT node is on a bus of a given type and has status okay. | |
#define | DT_ANY_INST_HAS_PROP_STATUS_OKAY(prop) COND_CODE_1(IS_EMPTY(DT_ANY_INST_HAS_PROP_STATUS_OKAY_(prop)), (0), (1)) |
Check if any DT_DRV_COMPAT node with status okay has a given property. | |
#define | DT_INST_FOREACH_STATUS_OKAY(fn) |
Call fn on all nodes with compatible DT_DRV_COMPAT and status okay | |
#define | DT_INST_FOREACH_STATUS_OKAY_VARGS(fn, ...) |
Call fn on all nodes with compatible DT_DRV_COMPAT and status okay with multiple arguments. | |
#define | DT_INST_FOREACH_NODELABEL(inst, fn) DT_FOREACH_NODELABEL(DT_DRV_INST(inst), fn) |
Call fn on all node labels for a given DT_DRV_COMPAT instance. | |
#define | DT_INST_FOREACH_NODELABEL_VARGS(inst, fn, ...) DT_FOREACH_NODELABEL_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__) |
Call fn on all node labels for a given DT_DRV_COMPAT instance with multiple arguments. | |
#define | DT_INST_FOREACH_PROP_ELEM(inst, prop, fn) DT_FOREACH_PROP_ELEM(DT_DRV_INST(inst), prop, fn) |
Invokes fn for each element of property prop for a DT_DRV_COMPAT instance. | |
#define | DT_INST_FOREACH_PROP_ELEM_SEP(inst, prop, fn, sep) DT_FOREACH_PROP_ELEM_SEP(DT_DRV_INST(inst), prop, fn, sep) |
Invokes fn for each element of property prop for a DT_DRV_COMPAT instance with a separator. | |
#define | DT_INST_FOREACH_PROP_ELEM_VARGS(inst, prop, fn, ...) DT_FOREACH_PROP_ELEM_VARGS(DT_DRV_INST(inst), prop, fn, __VA_ARGS__) |
Invokes fn for each element of property prop for a DT_DRV_COMPAT instance with multiple arguments. | |
#define | DT_INST_FOREACH_PROP_ELEM_SEP_VARGS(inst, prop, fn, sep, ...) |
Invokes fn for each element of property prop for a DT_DRV_COMPAT instance with multiple arguments and a separator. | |
#define | DT_INST_NODE_HAS_PROP(inst, prop) DT_NODE_HAS_PROP(DT_DRV_INST(inst), prop) |
Does a DT_DRV_COMPAT instance have a property? | |
#define | DT_INST_NODE_HAS_COMPAT(inst, compat) DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), compat) |
Does a DT_DRV_COMPAT instance have the compatible? | |
#define | DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, idx, cell) DT_PHA_HAS_CELL_AT_IDX(DT_DRV_INST(inst), pha, idx, cell) |
Does a phandle array have a named cell specifier at an index for a DT_DRV_COMPAT instance? | |
#define | DT_INST_PHA_HAS_CELL(inst, pha, cell) DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, 0, cell) |
Does a phandle array have a named cell specifier at index 0 for a DT_DRV_COMPAT instance? | |
#define | DT_INST_IRQ_HAS_IDX(inst, idx) DT_IRQ_HAS_IDX(DT_DRV_INST(inst), idx) |
is index valid for interrupt property on a DT_DRV_COMPAT instance? | |
#define | DT_INST_IRQ_HAS_CELL_AT_IDX(inst, idx, cell) DT_IRQ_HAS_CELL_AT_IDX(DT_DRV_INST(inst), idx, cell) |
Does a DT_DRV_COMPAT instance have an interrupt named cell specifier? | |
#define | DT_INST_IRQ_HAS_CELL(inst, cell) DT_INST_IRQ_HAS_CELL_AT_IDX(inst, 0, cell) |
Does a DT_DRV_COMPAT instance have an interrupt value? | |
#define | DT_INST_IRQ_HAS_NAME(inst, name) DT_IRQ_HAS_NAME(DT_DRV_INST(inst), name) |
Does a DT_DRV_COMPAT instance have an interrupt value? | |
Devicetree main header.
API for accessing the current application's devicetree macros.