Zephyr Project API  3.2.0
A Scalable Open Source RTOS
devicetree.h File Reference

Devicetree main header. More...

Go to the source code of this file.

Macros

#define DT_INVALID_NODE   _
 Name for an invalid node identifier. More...
 
#define DT_ROOT   DT_N
 Node identifier for the root node in the devicetree. More...
 
#define DT_PATH(...)   DT_PATH_INTERNAL(__VA_ARGS__)
 Get a node identifier for a devicetree path. More...
 
#define DT_NODELABEL(label)   DT_CAT(DT_N_NODELABEL_, label)
 Get a node identifier for a node label. More...
 
#define DT_ALIAS(alias)   DT_CAT(DT_N_ALIAS_, alias)
 Get a node identifier from /aliases. More...
 
#define DT_INST(inst, compat)   UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
 Get a node identifier for an instance of a compatible. More...
 
#define DT_PARENT(node_id)   UTIL_CAT(node_id, _PARENT)
 Get a node identifier for a parent node. More...
 
#define DT_INST_PARENT(inst)   DT_PARENT(DT_DRV_INST(inst))
 Get a DT_DRV_COMPAT parent's node identifier. More...
 
#define DT_GPARENT(node_id)   DT_PARENT(DT_PARENT(node_id))
 Get a node identifier for a grandparent node. More...
 
#define DT_CHILD(node_id, child)   UTIL_CAT(node_id, DT_S_PREFIX(child))
 Get a node identifier for a child node. More...
 
#define DT_COMPAT_GET_ANY_STATUS_OKAY(compat)
 Get a node identifier for a status okay node with a compatible. More...
 
#define DT_NODE_PATH(node_id)   DT_CAT(node_id, _PATH)
 Get a devicetree node's full path as a string literal. More...
 
#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. More...
 
#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. More...
 
#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? More...
 
#define DT_PROP(node_id, prop)   DT_CAT3(node_id, _P_, prop)
 Get a devicetree property value. More...
 
#define DT_PROP_LEN(node_id, prop)   DT_CAT4(node_id, _P_, prop, _LEN)
 Get a property's logical length. More...
 
#define DT_PROP_LEN_OR(node_id, prop, default_value)
 Like DT_PROP_LEN(), but with a fallback to default_value. More...
 
#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? More...
 
#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? More...
 
#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. More...
 
#define DT_PROP_OR(node_id, prop, default_value)
 Like DT_PROP(), but with a fallback to default_value. More...
 
#define DT_LABEL(node_id)   DT_PROP(node_id, label) __DEPRECATED_MACRO
 Equivalent to DT_PROP(node_id, label) More...
 
#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. More...
 
#define DT_ENUM_IDX_OR(node_id, prop, default_idx_value)
 Like DT_ENUM_IDX(), but with a fallback to a default enum index. More...
 
#define DT_STRING_TOKEN(node_id, prop)    DT_CAT4(node_id, _P_, prop, _STRING_TOKEN)
 Get a string property's value as a token. More...
 
#define DT_STRING_TOKEN_OR(node_id, prop, default_value)
 Like DT_STRING_TOKEN(), but with a fallback to default_value. More...
 
#define DT_STRING_UPPER_TOKEN(node_id, prop)    DT_CAT4(node_id, _P_, prop, _STRING_UPPER_TOKEN)
 Like DT_STRING_TOKEN(), but uppercased. More...
 
#define DT_STRING_UPPER_TOKEN_OR(node_id, prop, default_value)
 Like DT_STRING_UPPER_TOKEN(), but with a fallback to default_value. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#define DT_PHA_BY_IDX_OR(node_id, pha, idx, cell, default_value)    DT_PROP_OR(node_id, pha##_IDX_##idx##_VAL_##cell, default_value)
 Like DT_PHA_BY_IDX(), but with a fallback to default_value. More...
 
#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) More...
 
#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. More...
 
#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. More...
 
#define DT_PHA_BY_NAME_OR(node_id, pha, name, cell, default_value)    DT_PROP_OR(node_id, pha##_NAME_##name##_VAL_##cell, default_value)
 Like DT_PHA_BY_NAME(), but with a fallback to default_value. More...
 
#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. More...
 
#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. More...
 
#define DT_PHANDLE(node_id, prop)   DT_PHANDLE_BY_IDX(node_id, prop, 0)
 Get a node identifier for a phandle property's value. More...
 
#define DT_NUM_RANGES(node_id)   DT_CAT(node_id, _RANGES_NUM)
 Get the number of range blocks in the ranges property. More...
 
#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? More...
 
#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? More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#define DT_FOREACH_RANGE(node_id, fn)    DT_CAT(node_id, _FOREACH_RANGE)(fn)
 Invokes fn for each entry of node_id ranges property. More...
 
#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. More...
 
#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? More...
 
#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. More...
 
#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. More...
 
#define DT_NUM_REGS(node_id)   DT_CAT(node_id, _REG_NUM)
 Get the number of register blocks in the reg property. More...
 
#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? More...
 
#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. More...
 
#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. More...
 
#define DT_REG_ADDR(node_id)   DT_REG_ADDR_BY_IDX(node_id, 0)
 Get a node's (only) register block address. More...
 
#define DT_REG_SIZE(node_id)   DT_REG_SIZE_BY_IDX(node_id, 0)
 Get a node's (only) register block size. More...
 
#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. More...
 
#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. More...
 
#define DT_NUM_IRQS(node_id)   DT_CAT(node_id, _IRQ_NUM)
 Get the number of interrupt sources for the node. More...
 
#define DT_IRQ_HAS_IDX(node_id, idx)    IS_ENABLED(DT_CAT4(node_id, _IRQ_IDX_, idx, _EXISTS))
 Is idx a valid interrupt index? More...
 
#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. If it returns 0, it is an error to use that macro. More...
 
#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) More...
 
#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. If it returns 0, it is an error to use that macro. More...
 
#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. More...
 
#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. More...
 
#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). More...
 
#define DT_IRQN(node_id)   DT_IRQ(node_id, irq)
 Get a node's (only) irq number. More...
 
#define DT_CHOSEN(prop)   DT_CAT(DT_CHOSEN_, prop)
 Get a node identifier for a /chosen node property. More...
 
#define DT_HAS_CHOSEN(prop)   IS_ENABLED(DT_CAT3(DT_CHOSEN_, prop, _EXISTS))
 Test if the devicetree has a /chosen node. More...
 
#define DT_FOREACH_NODE(fn)   DT_FOREACH_HELPER(fn)
 Invokes fn for every node in the tree. More...
 
#define DT_FOREACH_STATUS_OKAY_NODE(fn)   DT_FOREACH_OKAY_HELPER(fn)
 Invokes fn for every status okay node in the tree. More...
 
#define DT_FOREACH_CHILD(node_id, fn)    DT_CAT(node_id, _FOREACH_CHILD)(fn)
 Invokes fn for each child of node_id. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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 More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#define DT_FOREACH_STATUS_OKAY(compat, fn)
 Invokes fn for each status okay node of a compatible. More...
 
#define DT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...)
 Invokes fn for each status okay node of a compatible with multiple arguments. More...
 
#define DT_NODE_EXISTS(node_id)   IS_ENABLED(DT_CAT(node_id, _EXISTS))
 Does a node identifier refer to a node? More...
 
#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? More...
 
#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? More...
 
#define DT_NUM_INST_STATUS_OKAY(compat)
 Get the number of instances of a given compatible with status okay More...
 
#define DT_NODE_HAS_COMPAT(node_id, compat)    IS_ENABLED(DT_CAT3(node_id, _COMPAT_MATCHES_, compat))
 Does a devicetree node match a compatible? More...
 
#define DT_NODE_HAS_COMPAT_STATUS(node_id, compat, status)    DT_NODE_HAS_COMPAT(node_id, compat) && DT_NODE_HAS_STATUS(node_id, status)
 Does a devicetree node have a compatible and status? More...
 
#define DT_NODE_HAS_PROP(node_id, prop)    IS_ENABLED(DT_CAT4(node_id, _P_, prop, _EXISTS))
 Does a devicetree node have a property? More...
 
#define DT_PHA_HAS_CELL_AT_IDX(node_id, pha, idx, cell)
 Does a phandle array have a named cell specifier at an index? More...
 
#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) More...
 
#define DT_BUS(node_id)   DT_CAT(node_id, _BUS)
 Node's bus controller. More...
 
#define DT_BUS_LABEL(node_id)   DT_PROP(DT_BUS(node_id), label) __DEPRECATED_MACRO
 Node's bus controller's label property. More...
 
#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? More...
 
#define DT_DRV_INST(inst)   DT_INST(inst, DT_DRV_COMPAT)
 Node identifier for an instance of a DT_DRV_COMPAT compatible. More...
 
#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) More...
 
#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). More...
 
#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. More...
 
#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). More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#define DT_INST_PROP(inst, prop)   DT_PROP(DT_DRV_INST(inst), prop)
 Get a DT_DRV_COMPAT instance property. More...
 
#define DT_INST_PROP_LEN(inst, prop)   DT_PROP_LEN(DT_DRV_INST(inst), prop)
 Get a DT_DRV_COMPAT property length. More...
 
#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? More...
 
#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? More...
 
#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. More...
 
#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. More...
 
#define DT_INST_LABEL(inst)   DT_INST_PROP(inst, label) __DEPRECATED_MACRO
 Get a DT_DRV_COMPAT instance's label property. More...
 
#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. More...
 
#define DT_INST_STRING_UPPER_TOKEN(inst, prop)    DT_STRING_UPPER_TOKEN(DT_DRV_INST(inst), prop)
 Like DT_INST_STRING_TOKEN(), but uppercased. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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) More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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? More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#define DT_INST_REG_ADDR(inst)   DT_INST_REG_ADDR_BY_IDX(inst, 0)
 Get a DT_DRV_COMPAT's (only) register block address. More...
 
#define DT_INST_REG_SIZE(inst)   DT_INST_REG_SIZE_BY_IDX(inst, 0)
 Get a DT_DRV_COMPAT's (only) register block size. More...
 
#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. More...
 
#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. More...
 
#define DT_INST_IRQ(inst, cell)   DT_INST_IRQ_BY_IDX(inst, 0, cell)
 Get a DT_DRV_COMPAT interrupt specifier's value. More...
 
#define DT_INST_IRQN(inst)   DT_INST_IRQ(inst, irq)
 Get a DT_DRV_COMPAT's (only) irq number. More...
 
#define DT_INST_BUS(inst)   DT_BUS(DT_DRV_INST(inst))
 Get a DT_DRV_COMPAT's bus node identifier. More...
 
#define DT_INST_BUS_LABEL(inst)   DT_BUS_LABEL(DT_DRV_INST(inst)) __DEPRECATED_MACRO
 Get a DT_DRV_COMPAT's bus node's label property. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#define DT_ANY_INST_ON_BUS_STATUS_OKAY(bus)    DT_COMPAT_ON_BUS_INTERNAL(DT_DRV_COMPAT, bus)
 Test if any DT_DRV_COMPAT node is on a bus of a given type and has status okay. More...
 
#define DT_INST_FOREACH_STATUS_OKAY(fn)
 Call fn on all nodes with compatible DT_DRV_COMPAT and status okay More...
 
#define DT_INST_FOREACH_STATUS_OKAY_VARGS(fn, ...)
 Call fn on all nodes with compatible DT_DRV_COMPAT and status okay with multiple arguments. More...
 
#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. More...
 
#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. More...
 
#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? More...
 
#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? More...
 
#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? More...
 
#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? More...
 
#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? More...
 
#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? More...
 
#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? More...
 

Detailed Description

Devicetree main header.

API for accessing the current application's devicetree macros.