Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 <devicetree_unfixed.h>
20#include <devicetree_fixups.h>
21
22#include <sys/util.h>
23
31/*
32 * Property suffixes
33 * -----------------
34 *
35 * These are the optional parts that come after the _P_<property>
36 * part in DT_N_<path-id>_P_<property-id> macros, or the "prop-suf"
37 * nonterminal in the DT guide's macros.bnf file.
38 *
39 * Before adding new ones, check this list to avoid conflicts. If any
40 * are missing from this list, please add them. It should be complete.
41 *
42 * _ENUM_IDX: property's value as an index into bindings enum
43 * _ENUM_TOKEN: property's value as a token into bindings enum (string
44 * enum values are identifiers) [deprecated, use _STRING_TOKEN]
45 * _ENUM_UPPER_TOKEN: like _ENUM_TOKEN, but uppercased [deprecated, use
46 * _STRING_UPPER_TOKEN]
47 * _EXISTS: property is defined
48 * _FOREACH_PROP_ELEM: helper for "iterating" over values in the property
49 * _FOREACH_PROP_ELEM_VARGS: foreach functions with variable number of arguments
50 * _IDX_<i>: logical index into property
51 * _IDX_<i>_EXISTS: logical index into property is defined
52 * _IDX_<i>_PH: phandle array's phandle by index (or phandle, phandles)
53 * _IDX_<i>_VAL_<val>: phandle array's specifier value by index
54 * _IDX_<i>_VAL_<val>_EXISTS: cell value exists, by index
55 * _LEN: property logical length
56 * _NAME_<name>_PH: phandle array's phandle by name
57 * _NAME_<name>_VAL_<val>: phandle array's property specifier by name
58 * _NAME_<name>_VAL_<val>_EXISTS: cell value exists, by name
59 * _STRING_TOKEN: string property's value as a token
60 * _STRING_UPPER_TOKEN: like _STRING_TOKEN, but uppercased
61 */
62
76#define DT_INVALID_NODE _
77
81#define DT_ROOT DT_N
82
129#define DT_PATH(...) DT_PATH_INTERNAL(__VA_ARGS__)
130
177#define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
178
213#define DT_ALIAS(alias) DT_CAT(DT_N_ALIAS_, alias)
214
305#define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
306
326#define DT_PARENT(node_id) UTIL_CAT(node_id, _PARENT)
327
333#define DT_INST_PARENT(inst) DT_PARENT(DT_DRV_INST(inst))
334
354#define DT_GPARENT(node_id) DT_PARENT(DT_PARENT(node_id))
355
387#define DT_CHILD(node_id, child) UTIL_CAT(node_id, DT_S_PREFIX(child))
388
425#define DT_COMPAT_GET_ANY_STATUS_OKAY(compat) \
426 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
427 (DT_INST(0, compat)), \
428 (DT_INVALID_NODE))
429
453#define DT_NODE_PATH(node_id) DT_CAT(node_id, _PATH)
454
475#define DT_NODE_FULL_NAME(node_id) DT_CAT(node_id, _FULL_NAME)
476
492#define DT_SAME_NODE(node_id1, node_id2) \
493 (DT_DEP_ORD(node_id1) == (DT_DEP_ORD(node_id2)))
494
495/* Implementation note: distinct nodes have distinct node identifiers.
496 * See include/devicetree/ordinals.h. */
497
538#define DT_PROP(node_id, prop) DT_CAT(node_id, _P_##prop)
539
568#define DT_PROP_LEN(node_id, prop) DT_PROP(node_id, prop##_LEN)
569
584#define DT_PROP_LEN_OR(node_id, prop, default_value) \
585 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
586 (DT_PROP_LEN(node_id, prop)), (default_value))
587
608#define DT_PROP_HAS_IDX(node_id, prop, idx) \
609 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _IDX_, idx, _EXISTS))
610
633#define DT_PROP_BY_IDX(node_id, prop, idx) DT_PROP(node_id, prop##_IDX_##idx)
634
648#define DT_PROP_OR(node_id, prop, default_value) \
649 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
650 (DT_PROP(node_id, prop)), (default_value))
651
660#define DT_LABEL(node_id) DT_PROP(node_id, label)
661
696#define DT_ENUM_IDX(node_id, prop) DT_PROP(node_id, prop##_ENUM_IDX)
697
712#define DT_ENUM_IDX_OR(node_id, prop, default_idx_value) \
713 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
714 (DT_ENUM_IDX(node_id, prop)), (default_idx_value))
715
768#define DT_STRING_TOKEN(node_id, prop) \
769 DT_CAT4(node_id, _P_, prop, _STRING_TOKEN)
770
820#define DT_STRING_UPPER_TOKEN(node_id, prop) \
821 DT_CAT4(node_id, _P_, prop, _STRING_UPPER_TOKEN)
822
823/*
824 * phandle properties
825 *
826 * These are special-cased to manage the impedance mismatch between
827 * phandles, which are just uint32_t node properties that only make sense
828 * within the tree itself, and C values.
829 */
830
870#define DT_PROP_BY_PHANDLE_IDX(node_id, phs, idx, prop) \
871 DT_PROP(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop)
872
892#define DT_PROP_BY_PHANDLE_IDX_OR(node_id, phs, idx, prop, default_value) \
893 DT_PROP_OR(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop, default_value)
894
906#define DT_PROP_BY_PHANDLE(node_id, ph, prop) \
907 DT_PROP_BY_PHANDLE_IDX(node_id, ph, 0, prop)
908
957#define DT_PHA_BY_IDX(node_id, pha, idx, cell) \
958 DT_PROP(node_id, pha##_IDX_##idx##_VAL_##cell)
959
977#define DT_PHA_BY_IDX_OR(node_id, pha, idx, cell, default_value) \
978 DT_PROP_OR(node_id, pha##_IDX_##idx##_VAL_##cell, default_value)
979/* Implementation note: the _IDX_##idx##_VAL_##cell##_EXISTS
980 * macros are defined, so it's safe to use DT_PROP_OR() here, because
981 * that uses an IS_ENABLED() on the _EXISTS macro.
982 */
983
991#define DT_PHA(node_id, pha, cell) DT_PHA_BY_IDX(node_id, pha, 0, cell)
992
1007#define DT_PHA_OR(node_id, pha, cell, default_value) \
1008 DT_PHA_BY_IDX_OR(node_id, pha, 0, cell, default_value)
1009
1044#define DT_PHA_BY_NAME(node_id, pha, name, cell) \
1045 DT_PROP(node_id, pha##_NAME_##name##_VAL_##cell)
1046
1062#define DT_PHA_BY_NAME_OR(node_id, pha, name, cell, default_value) \
1063 DT_PROP_OR(node_id, pha##_NAME_##name##_VAL_##cell, default_value)
1064/* Implementation note: the _NAME_##name##_VAL_##cell##_EXISTS
1065 * macros are defined, so it's safe to use DT_PROP_OR() here, because
1066 * that uses an IS_ENABLED() on the _EXISTS macro.
1067 */
1068
1112#define DT_PHANDLE_BY_NAME(node_id, pha, name) \
1113 DT_PROP(node_id, pha##_NAME_##name##_PH)
1114
1154#define DT_PHANDLE_BY_IDX(node_id, prop, idx) \
1155 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH)
1156/*
1157 * Implementation note: using DT_CAT6 above defers concatenation until
1158 * after expansion of each parameter. This is important when 'idx' is
1159 * expandable to a number, but it isn't one "yet".
1160 */
1161
1173#define DT_PHANDLE(node_id, prop) DT_PHANDLE_BY_IDX(node_id, prop, 0)
1174
1217#define DT_NUM_RANGES(node_id) DT_CAT(node_id, _RANGES_NUM)
1218
1268#define DT_RANGES_HAS_IDX(node_id, idx) \
1269 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _EXISTS))
1270
1319#define DT_RANGES_HAS_CHILD_BUS_FLAGS_AT_IDX(node_id, idx) \
1320 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS_EXISTS))
1321
1355#define DT_RANGES_CHILD_BUS_FLAGS_BY_IDX(node_id, idx) \
1356 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS)
1357
1400#define DT_RANGES_CHILD_BUS_ADDRESS_BY_IDX(node_id, idx) \
1401 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_ADDRESS)
1402
1445#define DT_RANGES_PARENT_BUS_ADDRESS_BY_IDX(node_id, idx) \
1446 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_PARENT_BUS_ADDRESS)
1447
1490#define DT_RANGES_LENGTH_BY_IDX(node_id, idx) \
1491 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_LENGTH)
1492
1526#define DT_FOREACH_RANGE(node_id, fn) \
1527 DT_CAT(node_id, _FOREACH_RANGE)(fn)
1528
1546#define DT_NUM_REGS(node_id) DT_CAT(node_id, _REG_NUM)
1547
1559#define DT_REG_HAS_IDX(node_id, idx) \
1560 IS_ENABLED(DT_CAT(node_id, _REG_IDX_##idx##_EXISTS))
1561
1568#define DT_REG_ADDR_BY_IDX(node_id, idx) \
1569 DT_CAT(node_id, _REG_IDX_##idx##_VAL_ADDRESS)
1570
1582#define DT_REG_SIZE_BY_IDX(node_id, idx) \
1583 DT_CAT(node_id, _REG_IDX_##idx##_VAL_SIZE)
1584
1592#define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)
1593
1601#define DT_REG_SIZE(node_id) DT_REG_SIZE_BY_IDX(node_id, 0)
1602
1609#define DT_REG_ADDR_BY_NAME(node_id, name) \
1610 DT_CAT(node_id, _REG_NAME_##name##_VAL_ADDRESS)
1611
1618#define DT_REG_SIZE_BY_NAME(node_id, name) \
1619 DT_CAT(node_id, _REG_NAME_##name##_VAL_SIZE)
1620
1639#define DT_NUM_IRQS(node_id) DT_CAT(node_id, _IRQ_NUM)
1640
1651#define DT_IRQ_HAS_IDX(node_id, idx) \
1652 IS_ENABLED(DT_CAT(node_id, _IRQ_IDX_##idx##_EXISTS))
1653
1664#define DT_IRQ_HAS_CELL_AT_IDX(node_id, idx, cell) \
1665 IS_ENABLED(DT_CAT(node_id, _IRQ_IDX_##idx##_VAL_##cell##_EXISTS))
1666
1674#define DT_IRQ_HAS_CELL(node_id, cell) DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell)
1675
1685#define DT_IRQ_HAS_NAME(node_id, name) \
1686 IS_ENABLED(DT_CAT(node_id, _IRQ_NAME_##name##_VAL_irq_EXISTS))
1687
1721#define DT_IRQ_BY_IDX(node_id, idx, cell) \
1722 DT_CAT(node_id, _IRQ_IDX_##idx##_VAL_##cell)
1723
1739#define DT_IRQ_BY_NAME(node_id, name, cell) \
1740 DT_CAT(node_id, _IRQ_NAME_##name##_VAL_##cell)
1741
1749#define DT_IRQ(node_id, cell) DT_IRQ_BY_IDX(node_id, 0, cell)
1750
1761#define DT_IRQN(node_id) DT_IRQ(node_id, irq)
1762
1781#define DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop)
1782
1789#define DT_HAS_CHOSEN(prop) IS_ENABLED(DT_CHOSEN_##prop##_EXISTS)
1790
1835#define DT_FOREACH_CHILD(node_id, fn) \
1836 DT_CAT(node_id, _FOREACH_CHILD)(fn)
1837
1850#define DT_FOREACH_CHILD_VARGS(node_id, fn, ...) \
1851 DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
1852
1865#define DT_FOREACH_CHILD_STATUS_OKAY(node_id, fn) \
1866 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY)(fn)
1867
1884#define DT_FOREACH_CHILD_STATUS_OKAY_VARGS(node_id, fn, ...) \
1885 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_VARGS)(fn, __VA_ARGS__)
1886
1931#define DT_FOREACH_PROP_ELEM(node_id, prop, fn) \
1932 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM)(fn)
1933
1951#define DT_FOREACH_PROP_ELEM_VARGS(node_id, prop, fn, ...) \
1952 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_VARGS)(fn, __VA_ARGS__)
1953
2003#define DT_FOREACH_STATUS_OKAY(compat, fn) \
2004 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
2005 (UTIL_CAT(DT_FOREACH_OKAY_, compat)(fn)), \
2006 ())
2007
2046#define DT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
2047 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
2048 (UTIL_CAT(DT_FOREACH_OKAY_VARGS_, \
2049 compat)(fn, __VA_ARGS__)), \
2050 ())
2051
2076#define DT_NODE_EXISTS(node_id) IS_ENABLED(DT_CAT(node_id, _EXISTS))
2077
2097#define DT_NODE_HAS_STATUS(node_id, status) \
2098 DT_NODE_HAS_STATUS_INTERNAL(node_id, status)
2099
2117#define DT_HAS_COMPAT_STATUS_OKAY(compat) \
2118 IS_ENABLED(DT_CAT(DT_COMPAT_HAS_OKAY_, compat))
2119
2126#define DT_NUM_INST_STATUS_OKAY(compat) \
2127 UTIL_AND(DT_HAS_COMPAT_STATUS_OKAY(compat), \
2128 UTIL_CAT(DT_N_INST, DT_DASH(compat, NUM_OKAY)))
2129
2153#define DT_NODE_HAS_COMPAT(node_id, compat) \
2154 IS_ENABLED(DT_CAT(node_id, _COMPAT_MATCHES_##compat))
2155
2168#define DT_NODE_HAS_COMPAT_STATUS(node_id, compat, status) \
2169 DT_NODE_HAS_COMPAT(node_id, compat) && DT_NODE_HAS_STATUS(node_id, status)
2170
2184#define DT_NODE_HAS_PROP(node_id, prop) \
2185 IS_ENABLED(DT_CAT(node_id, _P_##prop##_EXISTS))
2186
2187
2204#define DT_PHA_HAS_CELL_AT_IDX(node_id, pha, idx, cell) \
2205 IS_ENABLED(DT_PROP(node_id, \
2206 pha##_IDX_##idx##_VAL_##cell##_EXISTS))
2207
2217#define DT_PHA_HAS_CELL(node_id, pha, cell) \
2218 DT_PHA_HAS_CELL_AT_IDX(node_id, pha, 0, cell)
2219
2258#define DT_BUS(node_id) DT_CAT(node_id, _BUS)
2259
2265#define DT_BUS_LABEL(node_id) DT_PROP(DT_BUS(node_id), label)
2266
2291#define DT_ON_BUS(node_id, bus) IS_ENABLED(DT_CAT(node_id, _BUS_##bus))
2292
2309#define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
2310
2322#define DT_INST_FOREACH_CHILD(inst, fn) \
2323 DT_FOREACH_CHILD(DT_DRV_INST(inst), fn)
2324
2337#define DT_INST_FOREACH_CHILD_VARGS(inst, fn, ...) \
2338 DT_FOREACH_CHILD_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
2339
2346#define DT_INST_ENUM_IDX(inst, prop) \
2347 DT_ENUM_IDX(DT_DRV_INST(inst), prop)
2348
2357#define DT_INST_ENUM_IDX_OR(inst, prop, default_idx_value) \
2358 DT_ENUM_IDX_OR(DT_DRV_INST(inst), prop, default_idx_value)
2359
2366#define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
2367
2374#define DT_INST_PROP_LEN(inst, prop) DT_PROP_LEN(DT_DRV_INST(inst), prop)
2375
2385#define DT_INST_PROP_HAS_IDX(inst, prop, idx) \
2386 DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx)
2387
2395#define DT_INST_PROP_BY_IDX(inst, prop, idx) \
2396 DT_PROP_BY_IDX(DT_DRV_INST(inst), prop, idx)
2397
2405#define DT_INST_PROP_OR(inst, prop, default_value) \
2406 DT_PROP_OR(DT_DRV_INST(inst), prop, default_value)
2407
2413#define DT_INST_LABEL(inst) DT_INST_PROP(inst, label)
2414
2423#define DT_INST_PROP_BY_PHANDLE(inst, ph, prop) \
2424 DT_INST_PROP_BY_PHANDLE_IDX(inst, ph, 0, prop)
2425
2437#define DT_INST_PROP_BY_PHANDLE_IDX(inst, phs, idx, prop) \
2438 DT_PROP_BY_PHANDLE_IDX(DT_DRV_INST(inst), phs, idx, prop)
2439
2448#define DT_INST_PHA_BY_IDX(inst, pha, idx, cell) \
2449 DT_PHA_BY_IDX(DT_DRV_INST(inst), pha, idx, cell)
2450
2460#define DT_INST_PHA_BY_IDX_OR(inst, pha, idx, cell, default_value) \
2461 DT_PHA_BY_IDX_OR(DT_DRV_INST(inst), pha, idx, cell, default_value)
2462
2471#define DT_INST_PHA(inst, pha, cell) DT_INST_PHA_BY_IDX(inst, pha, 0, cell)
2472
2481#define DT_INST_PHA_OR(inst, pha, cell, default_value) \
2482 DT_INST_PHA_BY_IDX_OR(inst, pha, 0, cell, default_value)
2483
2493#define DT_INST_PHA_BY_NAME(inst, pha, name, cell) \
2494 DT_PHA_BY_NAME(DT_DRV_INST(inst), pha, name, cell)
2495
2505#define DT_INST_PHA_BY_NAME_OR(inst, pha, name, cell, default_value) \
2506 DT_PHA_BY_NAME_OR(DT_DRV_INST(inst), pha, name, cell, default_value)
2507
2516#define DT_INST_PHANDLE_BY_NAME(inst, pha, name) \
2517 DT_PHANDLE_BY_NAME(DT_DRV_INST(inst), pha, name) \
2518
2528#define DT_INST_PHANDLE_BY_IDX(inst, prop, idx) \
2529 DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), prop, idx)
2530
2539#define DT_INST_PHANDLE(inst, prop) DT_INST_PHANDLE_BY_IDX(inst, prop, 0)
2540
2548#define DT_INST_REG_HAS_IDX(inst, idx) DT_REG_HAS_IDX(DT_DRV_INST(inst), idx)
2549
2556#define DT_INST_REG_ADDR_BY_IDX(inst, idx) DT_REG_ADDR_BY_IDX(DT_DRV_INST(inst), idx)
2557
2564#define DT_INST_REG_SIZE_BY_IDX(inst, idx) \
2565 DT_REG_SIZE_BY_IDX(DT_DRV_INST(inst), idx)
2566
2573#define DT_INST_REG_ADDR_BY_NAME(inst, name) \
2574 DT_REG_ADDR_BY_NAME(DT_DRV_INST(inst), name)
2575
2582#define DT_INST_REG_SIZE_BY_NAME(inst, name) \
2583 DT_REG_SIZE_BY_NAME(DT_DRV_INST(inst), name)
2584
2590#define DT_INST_REG_ADDR(inst) DT_INST_REG_ADDR_BY_IDX(inst, 0)
2591
2597#define DT_INST_REG_SIZE(inst) DT_INST_REG_SIZE_BY_IDX(inst, 0)
2598
2606#define DT_INST_IRQ_BY_IDX(inst, idx, cell) \
2607 DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell)
2608
2616#define DT_INST_IRQ_BY_NAME(inst, name, cell) \
2617 DT_IRQ_BY_NAME(DT_DRV_INST(inst), name, cell)
2618
2625#define DT_INST_IRQ(inst, cell) DT_INST_IRQ_BY_IDX(inst, 0, cell)
2626
2632#define DT_INST_IRQN(inst) DT_INST_IRQ(inst, irq)
2633
2639#define DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst))
2640
2646#define DT_INST_BUS_LABEL(inst) DT_BUS_LABEL(DT_DRV_INST(inst))
2647
2655#define DT_INST_ON_BUS(inst, bus) DT_ON_BUS(DT_DRV_INST(inst), bus)
2656
2685#define DT_ANY_INST_ON_BUS_STATUS_OKAY(bus) \
2686 DT_COMPAT_ON_BUS_INTERNAL(DT_DRV_COMPAT, bus)
2687
2747#define DT_INST_FOREACH_STATUS_OKAY(fn) \
2748 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
2749 (UTIL_CAT(DT_FOREACH_OKAY_INST_, \
2750 DT_DRV_COMPAT)(fn)), \
2751 ())
2752
2764#define DT_INST_FOREACH_STATUS_OKAY_VARGS(fn, ...) \
2765 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
2766 (UTIL_CAT(DT_FOREACH_OKAY_INST_VARGS_, \
2767 DT_DRV_COMPAT)(fn, __VA_ARGS__)), \
2768 ())
2769
2780#define DT_INST_FOREACH_PROP_ELEM(inst, prop, fn) \
2781 DT_FOREACH_PROP_ELEM(DT_DRV_INST(inst), prop, fn)
2782
2797#define DT_INST_FOREACH_PROP_ELEM_VARGS(inst, prop, fn, ...) \
2798 DT_FOREACH_PROP_ELEM_VARGS(DT_DRV_INST(inst), prop, fn, __VA_ARGS__)
2799
2806#define DT_INST_NODE_HAS_PROP(inst, prop) \
2807 DT_NODE_HAS_PROP(DT_DRV_INST(inst), prop)
2808
2819#define DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, idx, cell) \
2820 DT_PHA_HAS_CELL_AT_IDX(DT_DRV_INST(inst), pha, idx, cell)
2821
2831#define DT_INST_PHA_HAS_CELL(inst, pha, cell) \
2832 DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, 0, cell)
2833
2841#define DT_INST_IRQ_HAS_IDX(inst, idx) DT_IRQ_HAS_IDX(DT_DRV_INST(inst), idx)
2842
2851#define DT_INST_IRQ_HAS_CELL_AT_IDX(inst, idx, cell) \
2852 DT_IRQ_HAS_CELL_AT_IDX(DT_DRV_INST(inst), idx, cell)
2853
2861#define DT_INST_IRQ_HAS_CELL(inst, cell) \
2862 DT_INST_IRQ_HAS_CELL_AT_IDX(inst, 0, cell)
2863
2870#define DT_INST_IRQ_HAS_NAME(inst, name) \
2871 DT_IRQ_HAS_NAME(DT_DRV_INST(inst), name)
2872
2878#define DT_PATH_INTERNAL(...) \
2879 UTIL_CAT(DT_ROOT, MACRO_MAP_CAT(DT_S_PREFIX, __VA_ARGS__))
2881#define DT_S_PREFIX(name) _S_##name
2882
2897#define DT_CAT(a1, a2) a1 ## a2
2899#define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
2901#define DT_CAT4(a1, a2, a3, a4) a1 ## a2 ## a3 ## a4
2903#define DT_CAT5(a1, a2, a3, a4, a5) a1 ## a2 ## a3 ## a4 ## a5
2905#define DT_CAT6(a1, a2, a3, a4, a5, a6) a1 ## a2 ## a3 ## a4 ## a5 ## a6
2906/*
2907 * If you need to define a bigger DT_CATN(), do so here. Don't leave
2908 * any "holes" of undefined macros, please.
2909 */
2910
2912#define DT_DASH(...) MACRO_MAP_CAT(DT_DASH_PREFIX, __VA_ARGS__)
2914#define DT_DASH_PREFIX(name) _##name
2916#define DT_NODE_HAS_STATUS_INTERNAL(node_id, status) \
2917 IS_ENABLED(DT_CAT(node_id, _STATUS_ ## status))
2919#define DT_COMPAT_ON_BUS_INTERNAL(compat, bus) \
2920 IS_ENABLED(UTIL_CAT(DT_CAT(DT_COMPAT_, compat), _BUS_##bus))
2921
2922/* have these last so they have access to all previously defined macros */
2923#include <devicetree/io-channels.h>
2924#include <devicetree/clocks.h>
2925#include <devicetree/gpio.h>
2926#include <devicetree/spi.h>
2927#include <devicetree/dma.h>
2928#include <devicetree/pwms.h>
2930#include <devicetree/zephyr.h>
2931#include <devicetree/ordinals.h>
2932#include <devicetree/pinctrl.h>
2933
2934#endif /* DEVICETREE_H */
Clocks Devicetree macro public API header file.
DMA Devicetree macro public API header file.
GPIO Devicetree macro public API header file.
Devicetree pin control helpers.
SPI Devicetree macro public API header file.
Zephyr-specific devicetree /chosen properties.
Flash Devicetree macro public API header file.
IO channels devicetree macro public API header file.
Devicetree node dependency ordinals.
PWMs Devicetree macro public API header file.
Misc utilities.