Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
devicetree.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: Apache-2.0
3 * Copyright (c) 2020 Nordic Semiconductor
4 * Copyright (c) 2020, Linaro Ltd.
5 *
6 * Not a generated file. Feel free to modify.
7 */
8
16#ifndef DEVICETREE_H
17#define DEVICETREE_H
18
19#include <zephyr/devicetree_generated.h>
21
22#if !defined(_LINKER) && !defined(_ASMLANGUAGE)
23#include <stdint.h>
24#endif
25
26#include <zephyr/sys/util.h>
27
37/*
38 * Property suffixes
39 * -----------------
40 *
41 * These are the optional parts that come after the _P_<property>
42 * part in DT_N_<path-id>_P_<property-id> macros, or the "prop-suf"
43 * nonterminal in the DT guide's macros.bnf file.
44 *
45 * Before adding new ones, check this list to avoid conflicts. If any
46 * are missing from this list, please add them. It should be complete.
47 *
48 * _ENUM_IDX: property's value as an index into bindings enum
49 * _ENUM_VAL_<val>_EXISTS property's value as a token exists
50 * _ENUM_TOKEN: property's value as a token into bindings enum (string
51 * enum values are identifiers) [deprecated, use _STRING_TOKEN]
52 * _ENUM_UPPER_TOKEN: like _ENUM_TOKEN, but uppercased [deprecated, use
53 * _STRING_UPPER_TOKEN]
54 * _EXISTS: property is defined
55 * _FOREACH_PROP_ELEM: helper for "iterating" over values in the property
56 * _FOREACH_PROP_ELEM_VARGS: foreach functions with variable number of arguments
57 * _IDX_<i>: logical index into property
58 * _IDX_<i>_EXISTS: logical index into property is defined
59 * _IDX_<i>_PH: phandle array's phandle by index (or phandle, phandles)
60 * _IDX_<i>_STRING_TOKEN: string array element value as a token
61 * _IDX_<i>_STRING_UPPER_TOKEN: string array element value as a uppercased token
62 * _IDX <i>_STRING_UNQUOTED: string array element value as a sequence of tokens, with no quotes
63 * _IDX_<i>_VAL_<val>: phandle array's specifier value by index
64 * _IDX_<i>_VAL_<val>_EXISTS: cell value exists, by index
65 * _LEN: property logical length
66 * _NAME_<name>_PH: phandle array's phandle by name
67 * _NAME_<name>_VAL_<val>: phandle array's property specifier by name
68 * _NAME_<name>_VAL_<val>_EXISTS: cell value exists, by name
69 * _STRING_TOKEN: string property's value as a token
70 * _STRING_UPPER_TOKEN: like _STRING_TOKEN, but uppercased
71 * _STRING_UNQUOTED: string property's value as a sequence of tokens, with no quotes
72 */
73
87#define DT_INVALID_NODE _
88
92#define DT_ROOT DT_N
93
144#define DT_PATH(...) DT_PATH_INTERNAL(__VA_ARGS__)
145
200#define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
201
240#define DT_ALIAS(alias) DT_CAT(DT_N_ALIAS_, alias)
241
336#define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
337
361#define DT_PARENT(node_id) DT_CAT(node_id, _PARENT)
362
386#define DT_GPARENT(node_id) DT_PARENT(DT_PARENT(node_id))
387
423#define DT_CHILD(node_id, child) UTIL_CAT(node_id, DT_S_PREFIX(child))
424
466#define DT_COMPAT_GET_ANY_STATUS_OKAY(compat) \
467 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
468 (DT_INST(0, compat)), \
469 (DT_INVALID_NODE))
470
498#define DT_NODE_PATH(node_id) DT_CAT(node_id, _PATH)
499
524#define DT_NODE_FULL_NAME(node_id) DT_CAT(node_id, _FULL_NAME)
525
552#define DT_NODE_FULL_NAME_UNQUOTED(node_id) DT_CAT(node_id, _FULL_NAME_UNQUOTED)
553
580#define DT_NODE_FULL_NAME_TOKEN(node_id) DT_CAT(node_id, _FULL_NAME_TOKEN)
581
610#define DT_NODE_FULL_NAME_UPPER_TOKEN(node_id) DT_CAT(node_id, _FULL_NAME_UPPER_TOKEN)
611
638#define DT_NODE_CHILD_IDX(node_id) DT_CAT(node_id, _CHILD_IDX)
639
646#define DT_CHILD_NUM(node_id) DT_CAT(node_id, _CHILD_NUM)
647
648
656#define DT_CHILD_NUM_STATUS_OKAY(node_id) \
657 DT_CAT(node_id, _CHILD_NUM_STATUS_OKAY)
658
679#define DT_SAME_NODE(node_id1, node_id2) \
680 (DT_DEP_ORD(node_id1) == (DT_DEP_ORD(node_id2)))
681
706#define DT_NODELABEL_STRING_ARRAY(node_id) \
707 { DT_FOREACH_NODELABEL(node_id, DT_NODELABEL_STRING_ARRAY_ENTRY_INTERNAL) }
708
749#define DT_PROP(node_id, prop) DT_CAT3(node_id, _P_, prop)
750
783#define DT_PROP_LEN(node_id, prop) DT_CAT4(node_id, _P_, prop, _LEN)
784
799#define DT_PROP_LEN_OR(node_id, prop, default_value) \
800 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
801 (DT_PROP_LEN(node_id, prop)), (default_value))
802
823#define DT_PROP_HAS_IDX(node_id, prop, idx) \
824 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _IDX_, idx, _EXISTS))
825
858#define DT_PROP_HAS_NAME(node_id, prop, name) \
859 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _NAME_, name, _EXISTS))
860
895#define DT_PROP_BY_IDX(node_id, prop, idx) \
896 DT_CAT5(node_id, _P_, prop, _IDX_, idx)
897
911#define DT_PROP_OR(node_id, prop, default_value) \
912 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
913 (DT_PROP(node_id, prop)), (default_value))
914
955#define DT_ENUM_IDX(node_id, prop) DT_CAT4(node_id, _P_, prop, _ENUM_IDX)
956
971#define DT_ENUM_IDX_OR(node_id, prop, default_idx_value) \
972 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
973 (DT_ENUM_IDX(node_id, prop)), (default_idx_value))
974
983#define DT_ENUM_HAS_VALUE(node_id, prop, value) \
984 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _ENUM_VAL_, value, _EXISTS))
985
1045#define DT_STRING_TOKEN(node_id, prop) \
1046 DT_CAT4(node_id, _P_, prop, _STRING_TOKEN)
1047
1061#define DT_STRING_TOKEN_OR(node_id, prop, default_value) \
1062 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1063 (DT_STRING_TOKEN(node_id, prop)), (default_value))
1064
1122#define DT_STRING_UPPER_TOKEN(node_id, prop) \
1123 DT_CAT4(node_id, _P_, prop, _STRING_UPPER_TOKEN)
1124
1139#define DT_STRING_UPPER_TOKEN_OR(node_id, prop, default_value) \
1140 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1141 (DT_STRING_UPPER_TOKEN(node_id, prop)), (default_value))
1142
1183#define DT_STRING_UNQUOTED(node_id, prop) \
1184 DT_CAT4(node_id, _P_, prop, _STRING_UNQUOTED)
1185
1200#define DT_STRING_UNQUOTED_OR(node_id, prop, default_value) \
1201 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1202 (DT_STRING_UNQUOTED(node_id, prop)), (default_value))
1203
1251#define DT_STRING_TOKEN_BY_IDX(node_id, prop, idx) \
1252 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_TOKEN)
1253
1301#define DT_STRING_UPPER_TOKEN_BY_IDX(node_id, prop, idx) \
1302 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UPPER_TOKEN)
1303
1344#define DT_STRING_UNQUOTED_BY_IDX(node_id, prop, idx) \
1345 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UNQUOTED)
1346
1347/*
1348 * phandle properties
1349 *
1350 * These are special-cased to manage the impedance mismatch between
1351 * phandles, which are just uint32_t node properties that only make sense
1352 * within the tree itself, and C values.
1353 */
1354
1400#define DT_PROP_BY_PHANDLE_IDX(node_id, phs, idx, prop) \
1401 DT_PROP(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop)
1402
1422#define DT_PROP_BY_PHANDLE_IDX_OR(node_id, phs, idx, prop, default_value) \
1423 DT_PROP_OR(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop, default_value)
1424
1436#define DT_PROP_BY_PHANDLE(node_id, ph, prop) \
1437 DT_PROP_BY_PHANDLE_IDX(node_id, ph, 0, prop)
1438
1493#define DT_PHA_BY_IDX(node_id, pha, idx, cell) \
1494 DT_CAT7(node_id, _P_, pha, _IDX_, idx, _VAL_, cell)
1495
1519#define DT_PHA_BY_IDX_OR(node_id, pha, idx, cell, default_value) \
1520 DT_PROP_OR(node_id, DT_CAT5(pha, _IDX_, idx, _VAL_, cell), default_value)
1521
1529#define DT_PHA(node_id, pha, cell) DT_PHA_BY_IDX(node_id, pha, 0, cell)
1530
1545#define DT_PHA_OR(node_id, pha, cell, default_value) \
1546 DT_PHA_BY_IDX_OR(node_id, pha, 0, cell, default_value)
1547
1588#define DT_PHA_BY_NAME(node_id, pha, name, cell) \
1589 DT_CAT7(node_id, _P_, pha, _NAME_, name, _VAL_, cell)
1590
1612#define DT_PHA_BY_NAME_OR(node_id, pha, name, cell, default_value) \
1613 DT_PROP_OR(node_id, DT_CAT5(pha, _NAME_, name, _VAL_, cell), default_value)
1614
1662#define DT_PHANDLE_BY_NAME(node_id, pha, name) \
1663 DT_CAT6(node_id, _P_, pha, _NAME_, name, _PH)
1664
1714#define DT_PHANDLE_BY_IDX(node_id, prop, idx) \
1715 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH)
1716
1728#define DT_PHANDLE(node_id, prop) DT_PHANDLE_BY_IDX(node_id, prop, 0)
1729
1776#define DT_NUM_RANGES(node_id) DT_CAT(node_id, _RANGES_NUM)
1777
1830#define DT_RANGES_HAS_IDX(node_id, idx) \
1831 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _EXISTS))
1832
1885#define DT_RANGES_HAS_CHILD_BUS_FLAGS_AT_IDX(node_id, idx) \
1886 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS_EXISTS))
1887
1925#define DT_RANGES_CHILD_BUS_FLAGS_BY_IDX(node_id, idx) \
1926 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS)
1927
1974#define DT_RANGES_CHILD_BUS_ADDRESS_BY_IDX(node_id, idx) \
1975 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_ADDRESS)
1976
2023#define DT_RANGES_PARENT_BUS_ADDRESS_BY_IDX(node_id, idx) \
2024 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_PARENT_BUS_ADDRESS)
2025
2072#define DT_RANGES_LENGTH_BY_IDX(node_id, idx) \
2073 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_LENGTH)
2074
2114#define DT_FOREACH_RANGE(node_id, fn) \
2115 DT_CAT(node_id, _FOREACH_RANGE)(fn)
2116
2162#define DT_NODE_VENDOR_BY_IDX(node_id, idx) \
2163 DT_CAT3(node_id, _COMPAT_VENDOR_IDX_, idx)
2164
2177#define DT_NODE_VENDOR_HAS_IDX(node_id, idx) \
2178 IS_ENABLED(DT_CAT4(node_id, _COMPAT_VENDOR_IDX_, idx, _EXISTS))
2179
2194#define DT_NODE_VENDOR_BY_IDX_OR(node_id, idx, default_value) \
2195 COND_CODE_1(DT_NODE_VENDOR_HAS_IDX(node_id, idx), \
2196 (DT_NODE_VENDOR_BY_IDX(node_id, idx)), (default_value))
2197
2206#define DT_NODE_VENDOR_OR(node_id, default_value) \
2207 DT_NODE_VENDOR_BY_IDX_OR(node_id, 0, default_value)
2208
2238#define DT_NODE_MODEL_BY_IDX(node_id, idx) \
2239 DT_CAT3(node_id, _COMPAT_MODEL_IDX_, idx)
2240
2253#define DT_NODE_MODEL_HAS_IDX(node_id, idx) \
2254 IS_ENABLED(DT_CAT4(node_id, _COMPAT_MODEL_IDX_, idx, _EXISTS))
2255
2270#define DT_NODE_MODEL_BY_IDX_OR(node_id, idx, default_value) \
2271 COND_CODE_1(DT_NODE_MODEL_HAS_IDX(node_id, idx), \
2272 (DT_NODE_MODEL_BY_IDX(node_id, idx)), (default_value))
2273
2282#define DT_NODE_MODEL_OR(node_id, default_value) \
2283 DT_NODE_MODEL_BY_IDX_OR(node_id, 0, default_value)
2284
2302#define DT_NUM_REGS(node_id) DT_CAT(node_id, _REG_NUM)
2303
2315#define DT_REG_HAS_IDX(node_id, idx) \
2316 IS_ENABLED(DT_CAT4(node_id, _REG_IDX_, idx, _EXISTS))
2317
2329#define DT_REG_HAS_NAME(node_id, name) \
2330 IS_ENABLED(DT_CAT4(node_id, _REG_NAME_, name, _EXISTS))
2331
2343#define DT_REG_ADDR_BY_IDX_RAW(node_id, idx) \
2344 DT_CAT4(node_id, _REG_IDX_, idx, _VAL_ADDRESS)
2345
2357#define DT_REG_ADDR_RAW(node_id) \
2358 DT_REG_ADDR_BY_IDX_RAW(node_id, 0)
2359
2366#define DT_REG_ADDR_BY_IDX(node_id, idx) \
2367 DT_U32_C(DT_REG_ADDR_BY_IDX_RAW(node_id, idx))
2368
2380#define DT_REG_SIZE_BY_IDX(node_id, idx) \
2381 DT_U32_C(DT_CAT4(node_id, _REG_IDX_, idx, _VAL_SIZE))
2382
2390#define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)
2391
2402#define DT_REG_ADDR_U64(node_id) DT_U64_C(DT_REG_ADDR_BY_IDX_RAW(node_id, 0))
2403
2411#define DT_REG_SIZE(node_id) DT_REG_SIZE_BY_IDX(node_id, 0)
2412
2419#define DT_REG_ADDR_BY_NAME(node_id, name) \
2420 DT_U32_C(DT_CAT4(node_id, _REG_NAME_, name, _VAL_ADDRESS))
2421
2430#define DT_REG_ADDR_BY_NAME_OR(node_id, name, default_value) \
2431 COND_CODE_1(DT_REG_HAS_NAME(node_id, name), \
2432 (DT_REG_ADDR_BY_NAME(node_id, name)), (default_value))
2433
2446#define DT_REG_ADDR_BY_NAME_U64(node_id, name) \
2447 DT_U64_C(DT_CAT4(node_id, _REG_NAME_, name, _VAL_ADDRESS))
2448
2455#define DT_REG_SIZE_BY_NAME(node_id, name) \
2456 DT_U32_C(DT_CAT4(node_id, _REG_NAME_, name, _VAL_SIZE))
2457
2466#define DT_REG_SIZE_BY_NAME_OR(node_id, name, default_value) \
2467 COND_CODE_1(DT_REG_HAS_NAME(node_id, name), \
2468 (DT_REG_SIZE_BY_NAME(node_id, name)), (default_value))
2469
2470
2489#define DT_NUM_IRQS(node_id) DT_CAT(node_id, _IRQ_NUM)
2490
2515#define DT_NUM_NODELABELS(node_id) DT_CAT(node_id, _NODELABEL_NUM)
2516
2523#define DT_IRQ_LEVEL(node_id) DT_CAT(node_id, _IRQ_LEVEL)
2524
2535#define DT_IRQ_HAS_IDX(node_id, idx) \
2536 IS_ENABLED(DT_CAT4(node_id, _IRQ_IDX_, idx, _EXISTS))
2537
2548#define DT_IRQ_HAS_CELL_AT_IDX(node_id, idx, cell) \
2549 IS_ENABLED(DT_CAT6(node_id, _IRQ_IDX_, idx, _VAL_, cell, _EXISTS))
2550
2558#define DT_IRQ_HAS_CELL(node_id, cell) DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell)
2559
2569#define DT_IRQ_HAS_NAME(node_id, name) \
2570 IS_ENABLED(DT_CAT4(node_id, _IRQ_NAME_, name, _VAL_irq_EXISTS))
2571
2607#define DT_IRQ_BY_IDX(node_id, idx, cell) \
2608 DT_CAT5(node_id, _IRQ_IDX_, idx, _VAL_, cell)
2609
2625#define DT_IRQ_BY_NAME(node_id, name, cell) \
2626 DT_CAT5(node_id, _IRQ_NAME_, name, _VAL_, cell)
2627
2635#define DT_IRQ(node_id, cell) DT_IRQ_BY_IDX(node_id, 0, cell)
2636
2679#define DT_IRQ_INTC_BY_IDX(node_id, idx) \
2680 DT_CAT4(node_id, _IRQ_IDX_, idx, _CONTROLLER)
2681
2726#define DT_IRQ_INTC_BY_NAME(node_id, name) \
2727 DT_CAT4(node_id, _IRQ_NAME_, name, _CONTROLLER)
2728
2768#define DT_IRQ_INTC(node_id) \
2769 DT_IRQ_INTC_BY_IDX(node_id, 0)
2770
2775/* DT helper macro to encode a node's IRQN to level 1 according to the multi-level scheme */
2776#define DT_IRQN_L1_INTERNAL(node_id, idx) DT_IRQ_BY_IDX(node_id, idx, irq)
2777/* DT helper macro to encode a node's IRQN to level 2 according to the multi-level scheme */
2778#define DT_IRQN_L2_INTERNAL(node_id, idx) \
2779 (IRQ_TO_L2(DT_IRQN_L1_INTERNAL(node_id, idx)) | \
2780 DT_IRQ(DT_IRQ_INTC_BY_IDX(node_id, idx), irq))
2781/* DT helper macro to encode a node's IRQN to level 3 according to the multi-level scheme */
2782#define DT_IRQN_L3_INTERNAL(node_id, idx) \
2783 (IRQ_TO_L3(DT_IRQN_L1_INTERNAL(node_id, idx)) | \
2784 IRQ_TO_L2(DT_IRQ(DT_IRQ_INTC_BY_IDX(node_id, idx), irq)) | \
2785 DT_IRQ(DT_IRQ_INTC(DT_IRQ_INTC_BY_IDX(node_id, idx)), irq))
2786/* DT helper macro for the macros above */
2787#define DT_IRQN_LVL_INTERNAL(node_id, idx, level) DT_CAT3(DT_IRQN_L, level, _INTERNAL)(node_id, idx)
2788
2793#define DT_MULTI_LEVEL_IRQN_INTERNAL(node_id, idx) \
2794 DT_IRQN_LVL_INTERNAL(node_id, idx, DT_IRQ_LEVEL(node_id))
2795
2808#define DT_IRQN_BY_IDX(node_id, idx) \
2809 COND_CODE_1(IS_ENABLED(CONFIG_MULTI_LEVEL_INTERRUPTS), \
2810 (DT_MULTI_LEVEL_IRQN_INTERNAL(node_id, idx)), \
2811 (DT_IRQ_BY_IDX(node_id, idx, irq)))
2812
2823#define DT_IRQN(node_id) DT_IRQN_BY_IDX(node_id, 0)
2824
2843#define DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop)
2844
2851#define DT_HAS_CHOSEN(prop) IS_ENABLED(DT_CAT3(DT_CHOSEN_, prop, _EXISTS))
2852
2872#define DT_FOREACH_NODE(fn) DT_FOREACH_HELPER(fn)
2873
2886#define DT_FOREACH_NODE_VARGS(fn, ...) DT_FOREACH_VARGS_HELPER(fn, __VA_ARGS__)
2887
2899#define DT_FOREACH_STATUS_OKAY_NODE(fn) DT_FOREACH_OKAY_HELPER(fn)
2900
2915#define DT_FOREACH_STATUS_OKAY_NODE_VARGS(fn, ...) DT_FOREACH_OKAY_VARGS_HELPER(fn, __VA_ARGS__)
2916
2960#define DT_FOREACH_CHILD(node_id, fn) \
2961 DT_CAT(node_id, _FOREACH_CHILD)(fn)
2962
3003#define DT_FOREACH_CHILD_SEP(node_id, fn, sep) \
3004 DT_CAT(node_id, _FOREACH_CHILD_SEP)(fn, sep)
3005
3021#define DT_FOREACH_CHILD_VARGS(node_id, fn, ...) \
3022 DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
3023
3039#define DT_FOREACH_CHILD_SEP_VARGS(node_id, fn, sep, ...) \
3040 DT_CAT(node_id, _FOREACH_CHILD_SEP_VARGS)(fn, sep, __VA_ARGS__)
3041
3057#define DT_FOREACH_CHILD_STATUS_OKAY(node_id, fn) \
3058 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY)(fn)
3059
3076#define DT_FOREACH_CHILD_STATUS_OKAY_SEP(node_id, fn, sep) \
3077 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP)(fn, sep)
3078
3098#define DT_FOREACH_CHILD_STATUS_OKAY_VARGS(node_id, fn, ...) \
3099 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_VARGS)(fn, __VA_ARGS__)
3100
3119#define DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(node_id, fn, sep, ...) \
3120 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP_VARGS)(fn, sep, __VA_ARGS__)
3121
3172#define DT_FOREACH_PROP_ELEM(node_id, prop, fn) \
3173 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM)(fn)
3174
3217#define DT_FOREACH_PROP_ELEM_SEP(node_id, prop, fn, sep) \
3218 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_SEP)(fn, sep)
3219
3240#define DT_FOREACH_PROP_ELEM_VARGS(node_id, prop, fn, ...) \
3241 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_VARGS)(fn, __VA_ARGS__)
3242
3259#define DT_FOREACH_PROP_ELEM_SEP_VARGS(node_id, prop, fn, sep, ...) \
3260 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_SEP_VARGS)( \
3261 fn, sep, __VA_ARGS__)
3262
3316#define DT_FOREACH_STATUS_OKAY(compat, fn) \
3317 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3318 (UTIL_CAT(DT_FOREACH_OKAY_, compat)(fn)), \
3319 ())
3320
3365#define DT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
3366 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3367 (DT_CAT(DT_FOREACH_OKAY_VARGS_, \
3368 compat)(fn, __VA_ARGS__)), \
3369 ())
3370
3383#define DT_COMPAT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
3384 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3385 (UTIL_CAT(DT_FOREACH_OKAY_INST_VARGS_, \
3386 compat)(fn, compat, __VA_ARGS__)), \
3387 ())
3388
3389
3428#define DT_FOREACH_NODELABEL(node_id, fn) DT_CAT(node_id, _FOREACH_NODELABEL)(fn)
3429
3467#define DT_FOREACH_NODELABEL_VARGS(node_id, fn, ...) \
3468 DT_CAT(node_id, _FOREACH_NODELABEL_VARGS)(fn, __VA_ARGS__)
3469
3494#define DT_NODE_EXISTS(node_id) IS_ENABLED(DT_CAT(node_id, _EXISTS))
3495
3517#define DT_NODE_HAS_STATUS(node_id, status) \
3518 DT_NODE_HAS_STATUS_INTERNAL(node_id, status)
3519
3540#define DT_NODE_HAS_STATUS_OKAY(node_id) DT_NODE_HAS_STATUS(node_id, okay)
3541
3561#define DT_HAS_COMPAT_STATUS_OKAY(compat) \
3562 IS_ENABLED(DT_CAT(DT_COMPAT_HAS_OKAY_, compat))
3563
3570#define DT_NUM_INST_STATUS_OKAY(compat) \
3571 UTIL_AND(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3572 UTIL_CAT(DT_N_INST, DT_DASH(compat, NUM_OKAY)))
3573
3601#define DT_NODE_HAS_COMPAT(node_id, compat) \
3602 IS_ENABLED(DT_CAT3(node_id, _COMPAT_MATCHES_, compat))
3603
3618#define DT_NODE_HAS_COMPAT_STATUS(node_id, compat, status) \
3619 UTIL_AND(DT_NODE_HAS_COMPAT(node_id, compat), DT_NODE_HAS_STATUS(node_id, status))
3620
3634#define DT_NODE_HAS_PROP(node_id, prop) \
3635 IS_ENABLED(DT_CAT4(node_id, _P_, prop, _EXISTS))
3636
3637
3654#define DT_PHA_HAS_CELL_AT_IDX(node_id, pha, idx, cell) \
3655 IS_ENABLED(DT_CAT8(node_id, _P_, pha, \
3656 _IDX_, idx, _VAL_, cell, _EXISTS))
3657
3667#define DT_PHA_HAS_CELL(node_id, pha, cell) \
3668 DT_PHA_HAS_CELL_AT_IDX(node_id, pha, 0, cell)
3669
3711#define DT_BUS(node_id) DT_CAT(node_id, _BUS)
3712
3741#define DT_ON_BUS(node_id, bus) IS_ENABLED(DT_CAT3(node_id, _BUS_, bus))
3742
3759#define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
3760
3768#define DT_INST_PARENT(inst) DT_PARENT(DT_DRV_INST(inst))
3769
3777#define DT_INST_GPARENT(inst) DT_GPARENT(DT_DRV_INST(inst))
3778
3788#define DT_INST_CHILD(inst, child) \
3789 DT_CHILD(DT_DRV_INST(inst), child)
3790
3800#define DT_INST_CHILD_NUM(inst) DT_CHILD_NUM(DT_DRV_INST(inst))
3801
3811#define DT_INST_CHILD_NUM_STATUS_OKAY(inst) \
3812 DT_CHILD_NUM_STATUS_OKAY(DT_DRV_INST(inst))
3813
3822#define DT_INST_NODELABEL_STRING_ARRAY(inst) DT_NODELABEL_STRING_ARRAY(DT_DRV_INST(inst))
3823
3832#define DT_INST_NUM_NODELABELS(inst) DT_NUM_NODELABELS(DT_DRV_INST(inst))
3833
3848#define DT_INST_FOREACH_CHILD(inst, fn) \
3849 DT_FOREACH_CHILD(DT_DRV_INST(inst), fn)
3850
3864#define DT_INST_FOREACH_CHILD_SEP(inst, fn, sep) \
3865 DT_FOREACH_CHILD_SEP(DT_DRV_INST(inst), fn, sep)
3866
3882#define DT_INST_FOREACH_CHILD_VARGS(inst, fn, ...) \
3883 DT_FOREACH_CHILD_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
3884
3899#define DT_INST_FOREACH_CHILD_SEP_VARGS(inst, fn, sep, ...) \
3900 DT_FOREACH_CHILD_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__)
3901
3913#define DT_INST_FOREACH_CHILD_STATUS_OKAY(inst, fn) \
3914 DT_FOREACH_CHILD_STATUS_OKAY(DT_DRV_INST(inst), fn)
3915
3930#define DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP(inst, fn, sep) \
3931 DT_FOREACH_CHILD_STATUS_OKAY_SEP(DT_DRV_INST(inst), fn, sep)
3932
3946#define DT_INST_FOREACH_CHILD_STATUS_OKAY_VARGS(inst, fn, ...) \
3947 DT_FOREACH_CHILD_STATUS_OKAY_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
3948
3964#define DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(inst, fn, sep, ...) \
3965 DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__)
3966
3973#define DT_INST_ENUM_IDX(inst, prop) \
3974 DT_ENUM_IDX(DT_DRV_INST(inst), prop)
3975
3984#define DT_INST_ENUM_IDX_OR(inst, prop, default_idx_value) \
3985 DT_ENUM_IDX_OR(DT_DRV_INST(inst), prop, default_idx_value)
3986
3995#define DT_INST_ENUM_HAS_VALUE(inst, prop, value) \
3996 DT_ENUM_HAS_VALUE(DT_DRV_INST(inst), prop, value)
3997
4004#define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
4005
4012#define DT_INST_PROP_LEN(inst, prop) DT_PROP_LEN(DT_DRV_INST(inst), prop)
4013
4023#define DT_INST_PROP_HAS_IDX(inst, prop, idx) \
4024 DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx)
4025
4034#define DT_INST_PROP_HAS_NAME(inst, prop, name) \
4035 DT_PROP_HAS_NAME(DT_DRV_INST(inst), prop, name)
4036
4044#define DT_INST_PROP_BY_IDX(inst, prop, idx) \
4045 DT_PROP_BY_IDX(DT_DRV_INST(inst), prop, idx)
4046
4054#define DT_INST_PROP_OR(inst, prop, default_value) \
4055 DT_PROP_OR(DT_DRV_INST(inst), prop, default_value)
4056
4064#define DT_INST_PROP_LEN_OR(inst, prop, default_value) \
4065 DT_PROP_LEN_OR(DT_DRV_INST(inst), prop, default_value)
4066
4076#define DT_INST_STRING_TOKEN(inst, prop) \
4077 DT_STRING_TOKEN(DT_DRV_INST(inst), prop)
4078
4086#define DT_INST_STRING_UPPER_TOKEN(inst, prop) \
4087 DT_STRING_UPPER_TOKEN(DT_DRV_INST(inst), prop)
4088
4097#define DT_INST_STRING_UNQUOTED(inst, prop) \
4098 DT_STRING_UNQUOTED(DT_DRV_INST(inst), prop)
4099
4107#define DT_INST_STRING_TOKEN_BY_IDX(inst, prop, idx) \
4108 DT_STRING_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx)
4109
4117#define DT_INST_STRING_UPPER_TOKEN_BY_IDX(inst, prop, idx) \
4118 DT_STRING_UPPER_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx)
4119
4127#define DT_INST_STRING_UNQUOTED_BY_IDX(inst, prop, idx) \
4128 DT_STRING_UNQUOTED_BY_IDX(DT_DRV_INST(inst), prop, idx)
4129
4138#define DT_INST_PROP_BY_PHANDLE(inst, ph, prop) \
4139 DT_INST_PROP_BY_PHANDLE_IDX(inst, ph, 0, prop)
4140
4152#define DT_INST_PROP_BY_PHANDLE_IDX(inst, phs, idx, prop) \
4153 DT_PROP_BY_PHANDLE_IDX(DT_DRV_INST(inst), phs, idx, prop)
4154
4163#define DT_INST_PHA_BY_IDX(inst, pha, idx, cell) \
4164 DT_PHA_BY_IDX(DT_DRV_INST(inst), pha, idx, cell)
4165
4175#define DT_INST_PHA_BY_IDX_OR(inst, pha, idx, cell, default_value) \
4176 DT_PHA_BY_IDX_OR(DT_DRV_INST(inst), pha, idx, cell, default_value)
4177
4186#define DT_INST_PHA(inst, pha, cell) DT_INST_PHA_BY_IDX(inst, pha, 0, cell)
4187
4196#define DT_INST_PHA_OR(inst, pha, cell, default_value) \
4197 DT_INST_PHA_BY_IDX_OR(inst, pha, 0, cell, default_value)
4198
4208#define DT_INST_PHA_BY_NAME(inst, pha, name, cell) \
4209 DT_PHA_BY_NAME(DT_DRV_INST(inst), pha, name, cell)
4210
4220#define DT_INST_PHA_BY_NAME_OR(inst, pha, name, cell, default_value) \
4221 DT_PHA_BY_NAME_OR(DT_DRV_INST(inst), pha, name, cell, default_value)
4222
4231#define DT_INST_PHANDLE_BY_NAME(inst, pha, name) \
4232 DT_PHANDLE_BY_NAME(DT_DRV_INST(inst), pha, name) \
4233
4243#define DT_INST_PHANDLE_BY_IDX(inst, prop, idx) \
4244 DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), prop, idx)
4245
4254#define DT_INST_PHANDLE(inst, prop) DT_INST_PHANDLE_BY_IDX(inst, prop, 0)
4255
4263#define DT_INST_REG_HAS_IDX(inst, idx) DT_REG_HAS_IDX(DT_DRV_INST(inst), idx)
4264
4272#define DT_INST_REG_HAS_NAME(inst, name) DT_REG_HAS_NAME(DT_DRV_INST(inst), name)
4273
4280#define DT_INST_REG_ADDR_BY_IDX_RAW(inst, idx) DT_REG_ADDR_BY_IDX_RAW(DT_DRV_INST(inst), idx)
4281
4288#define DT_INST_REG_ADDR_BY_IDX(inst, idx) DT_REG_ADDR_BY_IDX(DT_DRV_INST(inst), idx)
4289
4296#define DT_INST_REG_SIZE_BY_IDX(inst, idx) \
4297 DT_REG_SIZE_BY_IDX(DT_DRV_INST(inst), idx)
4298
4305#define DT_INST_REG_ADDR_BY_NAME(inst, name) \
4306 DT_REG_ADDR_BY_NAME(DT_DRV_INST(inst), name)
4307
4316#define DT_INST_REG_ADDR_BY_NAME_OR(inst, name, default_value) \
4317 DT_REG_ADDR_BY_NAME_OR(DT_DRV_INST(inst), name, default_value)
4318
4331#define DT_INST_REG_ADDR_BY_NAME_U64(inst, name) \
4332 DT_REG_ADDR_BY_NAME_U64(DT_DRV_INST(inst), name)
4333
4340#define DT_INST_REG_SIZE_BY_NAME(inst, name) \
4341 DT_REG_SIZE_BY_NAME(DT_DRV_INST(inst), name)
4342
4351#define DT_INST_REG_SIZE_BY_NAME_OR(inst, name, default_value) \
4352 DT_REG_SIZE_BY_NAME_OR(DT_DRV_INST(inst), name, default_value)
4353
4359#define DT_INST_REG_ADDR_RAW(inst) DT_INST_REG_ADDR_BY_IDX_RAW(inst, 0)
4360
4366#define DT_INST_REG_ADDR(inst) DT_INST_REG_ADDR_BY_IDX(inst, 0)
4367
4379#define DT_INST_REG_ADDR_U64(inst) DT_REG_ADDR_U64(DT_DRV_INST(inst))
4380
4386#define DT_INST_REG_SIZE(inst) DT_INST_REG_SIZE_BY_IDX(inst, 0)
4387
4394#define DT_INST_NUM_IRQS(inst) DT_NUM_IRQS(DT_DRV_INST(inst))
4395
4402#define DT_INST_IRQ_LEVEL(inst) DT_IRQ_LEVEL(DT_DRV_INST(inst))
4403
4411#define DT_INST_IRQ_BY_IDX(inst, idx, cell) \
4412 DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell)
4413
4420#define DT_INST_IRQ_INTC_BY_IDX(inst, idx) \
4421 DT_IRQ_INTC_BY_IDX(DT_DRV_INST(inst), idx)
4422
4429#define DT_INST_IRQ_INTC_BY_NAME(inst, name) \
4430 DT_IRQ_INTC_BY_NAME(DT_DRV_INST(inst), name)
4431
4439#define DT_INST_IRQ_INTC(inst) \
4440 DT_INST_IRQ_INTC_BY_IDX(inst, 0)
4441
4449#define DT_INST_IRQ_BY_NAME(inst, name, cell) \
4450 DT_IRQ_BY_NAME(DT_DRV_INST(inst), name, cell)
4451
4458#define DT_INST_IRQ(inst, cell) DT_INST_IRQ_BY_IDX(inst, 0, cell)
4459
4465#define DT_INST_IRQN(inst) DT_IRQN(DT_DRV_INST(inst))
4466
4473#define DT_INST_IRQN_BY_IDX(inst, idx) DT_IRQN_BY_IDX(DT_DRV_INST(inst), idx)
4474
4480#define DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst))
4481
4489#define DT_INST_ON_BUS(inst, bus) DT_ON_BUS(DT_DRV_INST(inst), bus)
4490
4500#define DT_INST_STRING_TOKEN_OR(inst, name, default_value) \
4501 DT_STRING_TOKEN_OR(DT_DRV_INST(inst), name, default_value)
4502
4511#define DT_INST_STRING_UPPER_TOKEN_OR(inst, name, default_value) \
4512 DT_STRING_UPPER_TOKEN_OR(DT_DRV_INST(inst), name, default_value)
4513
4522#define DT_INST_STRING_UNQUOTED_OR(inst, name, default_value) \
4523 DT_STRING_UNQUOTED_OR(DT_DRV_INST(inst), name, default_value)
4524
4525/*
4526 * @brief Test if any enabled node with the given compatible is on
4527 * the given bus type
4528 *
4529 * This is like DT_ANY_INST_ON_BUS_STATUS_OKAY(), except it can also
4530 * be useful for handling multiple compatibles in single source file.
4531 *
4532 * Example devicetree overlay:
4533 *
4534 * @code{.dts}
4535 * &i2c0 {
4536 * temp: temperature-sensor@76 {
4537 * compatible = "vnd,some-sensor";
4538 * reg = <0x76>;
4539 * };
4540 * };
4541 * @endcode
4542 *
4543 * Example usage, assuming `i2c0` is an I2C bus controller node, and
4544 * therefore `temp` is on an I2C bus:
4545 *
4546 * @code{.c}
4547 * DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(vnd_some_sensor, i2c) // 1
4548 * @endcode
4549 *
4550 * @param compat lowercase-and-underscores compatible, without quotes
4551 * @param bus a binding's bus type as a C token, lowercased and without quotes
4552 * @return 1 if any enabled node with that compatible is on that bus type,
4553 * 0 otherwise
4554 */
4555#define DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(compat, bus) \
4556 IS_ENABLED(DT_CAT4(DT_COMPAT_, compat, _BUS_, bus))
4557
4590#define DT_ANY_INST_ON_BUS_STATUS_OKAY(bus) \
4591 DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(DT_DRV_COMPAT, bus)
4592
4637#define DT_ANY_INST_HAS_PROP_STATUS_OKAY(prop) \
4638 COND_CODE_1(IS_EMPTY(DT_ANY_INST_HAS_PROP_STATUS_OKAY_(prop)), (0), (1))
4639
4684#define DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(compat, prop) \
4685 (DT_COMPAT_FOREACH_STATUS_OKAY_VARGS(compat, DT_COMPAT_NODE_HAS_PROP_AND_OR, prop) 0)
4686
4752#define DT_INST_FOREACH_STATUS_OKAY(fn) \
4753 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
4754 (UTIL_CAT(DT_FOREACH_OKAY_INST_, \
4755 DT_DRV_COMPAT)(fn)), \
4756 ())
4757
4770#define DT_INST_FOREACH_STATUS_OKAY_VARGS(fn, ...) \
4771 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
4772 (UTIL_CAT(DT_FOREACH_OKAY_INST_VARGS_, \
4773 DT_DRV_COMPAT)(fn, __VA_ARGS__)), \
4774 ())
4775
4785#define DT_INST_FOREACH_NODELABEL(inst, fn) \
4786 DT_FOREACH_NODELABEL(DT_DRV_INST(inst), fn)
4787
4799#define DT_INST_FOREACH_NODELABEL_VARGS(inst, fn, ...) \
4800 DT_FOREACH_NODELABEL_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
4801
4812#define DT_INST_FOREACH_PROP_ELEM(inst, prop, fn) \
4813 DT_FOREACH_PROP_ELEM(DT_DRV_INST(inst), prop, fn)
4814
4827#define DT_INST_FOREACH_PROP_ELEM_SEP(inst, prop, fn, sep) \
4828 DT_FOREACH_PROP_ELEM_SEP(DT_DRV_INST(inst), prop, fn, sep)
4829
4844#define DT_INST_FOREACH_PROP_ELEM_VARGS(inst, prop, fn, ...) \
4845 DT_FOREACH_PROP_ELEM_VARGS(DT_DRV_INST(inst), prop, fn, __VA_ARGS__)
4846
4864#define DT_INST_FOREACH_PROP_ELEM_SEP_VARGS(inst, prop, fn, sep, ...) \
4865 DT_FOREACH_PROP_ELEM_SEP_VARGS(DT_DRV_INST(inst), prop, fn, sep, \
4866 __VA_ARGS__)
4867
4874#define DT_INST_NODE_HAS_PROP(inst, prop) \
4875 DT_NODE_HAS_PROP(DT_DRV_INST(inst), prop)
4876
4883#define DT_INST_NODE_HAS_COMPAT(inst, compat) \
4884 DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), compat)
4885
4896#define DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, idx, cell) \
4897 DT_PHA_HAS_CELL_AT_IDX(DT_DRV_INST(inst), pha, idx, cell)
4898
4908#define DT_INST_PHA_HAS_CELL(inst, pha, cell) \
4909 DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, 0, cell)
4910
4918#define DT_INST_IRQ_HAS_IDX(inst, idx) DT_IRQ_HAS_IDX(DT_DRV_INST(inst), idx)
4919
4928#define DT_INST_IRQ_HAS_CELL_AT_IDX(inst, idx, cell) \
4929 DT_IRQ_HAS_CELL_AT_IDX(DT_DRV_INST(inst), idx, cell)
4930
4938#define DT_INST_IRQ_HAS_CELL(inst, cell) \
4939 DT_INST_IRQ_HAS_CELL_AT_IDX(inst, 0, cell)
4940
4947#define DT_INST_IRQ_HAS_NAME(inst, name) \
4948 DT_IRQ_HAS_NAME(DT_DRV_INST(inst), name)
4949
4967#define DT_ANY_INST_HAS_PROP_STATUS_OKAY__(idx, prop) \
4968 COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, prop), (1,), ())
4981#define DT_ANY_INST_HAS_PROP_STATUS_OKAY_(prop) \
4982 DT_INST_FOREACH_STATUS_OKAY_VARGS(DT_ANY_INST_HAS_PROP_STATUS_OKAY__, prop)
4983
4984#define DT_PATH_INTERNAL(...) \
4985 UTIL_CAT(DT_ROOT, MACRO_MAP_CAT(DT_S_PREFIX, __VA_ARGS__))
4991#define DT_S_PREFIX(name) _S_##name
4992
5007#define DT_CAT(a1, a2) a1 ## a2
5009#define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
5011#define DT_CAT4(a1, a2, a3, a4) a1 ## a2 ## a3 ## a4
5013#define DT_CAT5(a1, a2, a3, a4, a5) a1 ## a2 ## a3 ## a4 ## a5
5015#define DT_CAT6(a1, a2, a3, a4, a5, a6) a1 ## a2 ## a3 ## a4 ## a5 ## a6
5017#define DT_CAT7(a1, a2, a3, a4, a5, a6, a7) \
5018 a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
5020#define DT_CAT8(a1, a2, a3, a4, a5, a6, a7, a8) \
5021 a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7 ## a8
5022/*
5023 * If you need to define a bigger DT_CATN(), do so here. Don't leave
5024 * any "holes" of undefined macros, please.
5025 */
5026
5028#define DT_DASH(...) MACRO_MAP_CAT(DT_DASH_PREFIX, __VA_ARGS__)
5030#define DT_DASH_PREFIX(name) _##name
5032#define DT_NODE_HAS_STATUS_INTERNAL(node_id, status) \
5033 IS_ENABLED(DT_CAT3(node_id, _STATUS_, status))
5034
5038#define DT_COMPAT_NODE_HAS_PROP_AND_OR(inst, compat, prop) \
5039 DT_NODE_HAS_PROP(DT_INST(inst, compat), prop) ||
5040
5045#if defined(_LINKER) || defined(_ASMLANGUAGE)
5046#define DT_U32_C(_v) (_v)
5047#else
5048#define DT_U32_C(_v) UINT32_C(_v)
5049#endif
5050
5055#if defined(_LINKER) || defined(_ASMLANGUAGE)
5056#define DT_U64_C(_v) (_v)
5057#else
5058#define DT_U64_C(_v) UINT64_C(_v)
5059#endif
5060
5061/* Helpers for DT_NODELABEL_STRING_ARRAY. We define our own stringify
5062 * in order to avoid adding a dependency on toolchain.h..
5063 */
5064#define DT_NODELABEL_STRING_ARRAY_ENTRY_INTERNAL(nodelabel) DT_STRINGIFY_INTERNAL(nodelabel),
5065#define DT_STRINGIFY_INTERNAL(arg) DT_STRINGIFY_INTERNAL_HELPER(arg)
5066#define DT_STRINGIFY_INTERNAL_HELPER(arg) #arg
5067
5070/* have these last so they have access to all previously defined macros */
5073#include <zephyr/devicetree/gpio.h>
5074#include <zephyr/devicetree/spi.h>
5075#include <zephyr/devicetree/dma.h>
5076#include <zephyr/devicetree/pwms.h>
5080#include <zephyr/devicetree/can.h>
5082#include <zephyr/devicetree/mbox.h>
5083
5084#endif /* DEVICETREE_H */
Clocks Devicetree macro public API header file.
CAN devicetree macro public API header file.
DMA Devicetree macro public API header file.
GPIO Devicetree macro public API header file.
MBOX Devicetree macro public API header file.
Devicetree pin control helpers.
Reset Controller Devicetree macro public API header file.
SPI Devicetree macro public API header file.
Flash Devicetree macro public API header file.
IO channels devicetree macro public API header file.
Public interface for multi-level interrupts.
Devicetree node dependency ordinals.
PWMs Devicetree macro public API header file.
Misc utilities.