Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
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
347#define DT_GPARENT(node_id) DT_PARENT(DT_PARENT(node_id))
348
380#define DT_CHILD(node_id, child) UTIL_CAT(node_id, DT_S_PREFIX(child))
381
418#define DT_COMPAT_GET_ANY_STATUS_OKAY(compat) \
419 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
420 (DT_INST(0, compat)), \
421 (DT_INVALID_NODE))
422
446#define DT_NODE_PATH(node_id) DT_CAT(node_id, _PATH)
447
468#define DT_NODE_FULL_NAME(node_id) DT_CAT(node_id, _FULL_NAME)
469
485#define DT_SAME_NODE(node_id1, node_id2) \
486 (DT_DEP_ORD(node_id1) == (DT_DEP_ORD(node_id2)))
487
488/* Implementation note: distinct nodes have distinct node identifiers.
489 * See include/devicetree/ordinals.h. */
490
531#define DT_PROP(node_id, prop) DT_CAT(node_id, _P_##prop)
532
560#define DT_PROP_LEN(node_id, prop) DT_PROP(node_id, prop##_LEN)
561
576#define DT_PROP_LEN_OR(node_id, prop, default_value) \
577 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
578 (DT_PROP_LEN(node_id, prop)), (default_value))
579
600#define DT_PROP_HAS_IDX(node_id, prop, idx) \
601 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _IDX_, idx, _EXISTS))
602
625#define DT_PROP_BY_IDX(node_id, prop, idx) DT_PROP(node_id, prop##_IDX_##idx)
626
640#define DT_PROP_OR(node_id, prop, default_value) \
641 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
642 (DT_PROP(node_id, prop)), (default_value))
643
652#define DT_LABEL(node_id) DT_PROP(node_id, label)
653
688#define DT_ENUM_IDX(node_id, prop) DT_PROP(node_id, prop##_ENUM_IDX)
689
704#define DT_ENUM_IDX_OR(node_id, prop, default_idx_value) \
705 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
706 (DT_ENUM_IDX(node_id, prop)), (default_idx_value))
707
760#define DT_STRING_TOKEN(node_id, prop) \
761 DT_CAT4(node_id, _P_, prop, _STRING_TOKEN)
762
812#define DT_STRING_UPPER_TOKEN(node_id, prop) \
813 DT_CAT4(node_id, _P_, prop, _STRING_UPPER_TOKEN)
814
876#define DT_ENUM_TOKEN(node_id, prop) \
877 __DEPRECATED_MACRO \
878 DT_CAT4(node_id, _P_, prop, _ENUM_TOKEN)
879
936#define DT_ENUM_UPPER_TOKEN(node_id, prop) \
937 __DEPRECATED_MACRO \
938 DT_CAT4(node_id, _P_, prop, _ENUM_UPPER_TOKEN)
939
940/*
941 * phandle properties
942 *
943 * These are special-cased to manage the impedance mismatch between
944 * phandles, which are just uint32_t node properties that only make sense
945 * within the tree itself, and C values.
946 */
947
987#define DT_PROP_BY_PHANDLE_IDX(node_id, phs, idx, prop) \
988 DT_PROP(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop)
989
1009#define DT_PROP_BY_PHANDLE_IDX_OR(node_id, phs, idx, prop, default_value) \
1010 DT_PROP_OR(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop, default_value)
1011
1023#define DT_PROP_BY_PHANDLE(node_id, ph, prop) \
1024 DT_PROP_BY_PHANDLE_IDX(node_id, ph, 0, prop)
1025
1074#define DT_PHA_BY_IDX(node_id, pha, idx, cell) \
1075 DT_PROP(node_id, pha##_IDX_##idx##_VAL_##cell)
1076
1094#define DT_PHA_BY_IDX_OR(node_id, pha, idx, cell, default_value) \
1095 DT_PROP_OR(node_id, pha##_IDX_##idx##_VAL_##cell, default_value)
1096/* Implementation note: the _IDX_##idx##_VAL_##cell##_EXISTS
1097 * macros are defined, so it's safe to use DT_PROP_OR() here, because
1098 * that uses an IS_ENABLED() on the _EXISTS macro.
1099 */
1100
1108#define DT_PHA(node_id, pha, cell) DT_PHA_BY_IDX(node_id, pha, 0, cell)
1109
1124#define DT_PHA_OR(node_id, pha, cell, default_value) \
1125 DT_PHA_BY_IDX_OR(node_id, pha, 0, cell, default_value)
1126
1161#define DT_PHA_BY_NAME(node_id, pha, name, cell) \
1162 DT_PROP(node_id, pha##_NAME_##name##_VAL_##cell)
1163
1179#define DT_PHA_BY_NAME_OR(node_id, pha, name, cell, default_value) \
1180 DT_PROP_OR(node_id, pha##_NAME_##name##_VAL_##cell, default_value)
1181/* Implementation note: the _NAME_##name##_VAL_##cell##_EXISTS
1182 * macros are defined, so it's safe to use DT_PROP_OR() here, because
1183 * that uses an IS_ENABLED() on the _EXISTS macro.
1184 */
1185
1229#define DT_PHANDLE_BY_NAME(node_id, pha, name) \
1230 DT_PROP(node_id, pha##_NAME_##name##_PH)
1231
1271#define DT_PHANDLE_BY_IDX(node_id, prop, idx) \
1272 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH)
1273/*
1274 * Implementation note: using DT_CAT6 above defers concatenation until
1275 * after expansion of each parameter. This is important when 'idx' is
1276 * expandable to a number, but it isn't one "yet".
1277 */
1278
1290#define DT_PHANDLE(node_id, prop) DT_PHANDLE_BY_IDX(node_id, prop, 0)
1291
1309#define DT_NUM_REGS(node_id) DT_CAT(node_id, _REG_NUM)
1310
1322#define DT_REG_HAS_IDX(node_id, idx) \
1323 IS_ENABLED(DT_CAT(node_id, _REG_IDX_##idx##_EXISTS))
1324
1331#define DT_REG_ADDR_BY_IDX(node_id, idx) \
1332 DT_CAT(node_id, _REG_IDX_##idx##_VAL_ADDRESS)
1333
1345#define DT_REG_SIZE_BY_IDX(node_id, idx) \
1346 DT_CAT(node_id, _REG_IDX_##idx##_VAL_SIZE)
1347
1355#define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)
1356
1364#define DT_REG_SIZE(node_id) DT_REG_SIZE_BY_IDX(node_id, 0)
1365
1372#define DT_REG_ADDR_BY_NAME(node_id, name) \
1373 DT_CAT(node_id, _REG_NAME_##name##_VAL_ADDRESS)
1374
1381#define DT_REG_SIZE_BY_NAME(node_id, name) \
1382 DT_CAT(node_id, _REG_NAME_##name##_VAL_SIZE)
1383
1402#define DT_NUM_IRQS(node_id) DT_CAT(node_id, _IRQ_NUM)
1403
1414#define DT_IRQ_HAS_IDX(node_id, idx) \
1415 IS_ENABLED(DT_CAT(node_id, _IRQ_IDX_##idx##_EXISTS))
1416
1427#define DT_IRQ_HAS_CELL_AT_IDX(node_id, idx, cell) \
1428 IS_ENABLED(DT_CAT(node_id, _IRQ_IDX_##idx##_VAL_##cell##_EXISTS))
1429
1437#define DT_IRQ_HAS_CELL(node_id, cell) DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell)
1438
1448#define DT_IRQ_HAS_NAME(node_id, name) \
1449 IS_ENABLED(DT_CAT(node_id, _IRQ_NAME_##name##_VAL_irq_EXISTS))
1450
1484#define DT_IRQ_BY_IDX(node_id, idx, cell) \
1485 DT_CAT(node_id, _IRQ_IDX_##idx##_VAL_##cell)
1486
1502#define DT_IRQ_BY_NAME(node_id, name, cell) \
1503 DT_CAT(node_id, _IRQ_NAME_##name##_VAL_##cell)
1504
1512#define DT_IRQ(node_id, cell) DT_IRQ_BY_IDX(node_id, 0, cell)
1513
1524#define DT_IRQN(node_id) DT_IRQ(node_id, irq)
1525
1544#define DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop)
1545
1552#define DT_HAS_CHOSEN(prop) IS_ENABLED(DT_CHOSEN_##prop##_EXISTS)
1553
1598#define DT_FOREACH_CHILD(node_id, fn) \
1599 DT_CAT(node_id, _FOREACH_CHILD)(fn)
1600
1613#define DT_FOREACH_CHILD_VARGS(node_id, fn, ...) \
1614 DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
1615
1628#define DT_FOREACH_CHILD_STATUS_OKAY(node_id, fn) \
1629 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY)(fn)
1630
1647#define DT_FOREACH_CHILD_STATUS_OKAY_VARGS(node_id, fn, ...) \
1648 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_VARGS)(fn, __VA_ARGS__)
1649
1694#define DT_FOREACH_PROP_ELEM(node_id, prop, fn) \
1695 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM)(fn)
1696
1714#define DT_FOREACH_PROP_ELEM_VARGS(node_id, prop, fn, ...) \
1715 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_VARGS)(fn, __VA_ARGS__)
1716
1767#define DT_FOREACH_STATUS_OKAY(compat, fn) \
1768 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
1769 (UTIL_CAT(DT_FOREACH_OKAY_, compat)(fn)), \
1770 ())
1771
1810#define DT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
1811 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
1812 (UTIL_CAT(DT_FOREACH_OKAY_VARGS_, \
1813 compat)(fn, __VA_ARGS__)), \
1814 ())
1815
1840#define DT_NODE_EXISTS(node_id) IS_ENABLED(DT_CAT(node_id, _EXISTS))
1841
1861#define DT_NODE_HAS_STATUS(node_id, status) \
1862 DT_NODE_HAS_STATUS_INTERNAL(node_id, status)
1863
1881#define DT_HAS_COMPAT_STATUS_OKAY(compat) \
1882 IS_ENABLED(DT_CAT(DT_COMPAT_HAS_OKAY_, compat))
1883
1890#define DT_NUM_INST_STATUS_OKAY(compat) \
1891 UTIL_AND(DT_HAS_COMPAT_STATUS_OKAY(compat), \
1892 UTIL_CAT(DT_N_INST, DT_DASH(compat, NUM_OKAY)))
1893
1917#define DT_NODE_HAS_COMPAT(node_id, compat) \
1918 IS_ENABLED(DT_CAT(node_id, _COMPAT_MATCHES_##compat))
1919
1932#define DT_NODE_HAS_COMPAT_STATUS(node_id, compat, status) \
1933 DT_NODE_HAS_COMPAT(node_id, compat) && DT_NODE_HAS_STATUS(node_id, status)
1934
1948#define DT_NODE_HAS_PROP(node_id, prop) \
1949 IS_ENABLED(DT_CAT(node_id, _P_##prop##_EXISTS))
1950
1951
1968#define DT_PHA_HAS_CELL_AT_IDX(node_id, pha, idx, cell) \
1969 IS_ENABLED(DT_PROP(node_id, \
1970 pha##_IDX_##idx##_VAL_##cell##_EXISTS))
1971
1981#define DT_PHA_HAS_CELL(node_id, pha, cell) \
1982 DT_PHA_HAS_CELL_AT_IDX(node_id, pha, 0, cell)
1983
2022#define DT_BUS(node_id) DT_CAT(node_id, _BUS)
2023
2029#define DT_BUS_LABEL(node_id) DT_PROP(DT_BUS(node_id), label)
2030
2055#define DT_ON_BUS(node_id, bus) IS_ENABLED(DT_CAT(node_id, _BUS_##bus))
2056
2073#define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
2074
2086#define DT_INST_FOREACH_CHILD(inst, fn) \
2087 DT_FOREACH_CHILD(DT_DRV_INST(inst), fn)
2088
2101#define DT_INST_FOREACH_CHILD_VARGS(inst, fn, ...) \
2102 DT_FOREACH_CHILD_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
2103
2110#define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
2111
2118#define DT_INST_PROP_LEN(inst, prop) DT_PROP_LEN(DT_DRV_INST(inst), prop)
2119
2129#define DT_INST_PROP_HAS_IDX(inst, prop, idx) \
2130 DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx)
2131
2139#define DT_INST_PROP_BY_IDX(inst, prop, idx) \
2140 DT_PROP_BY_IDX(DT_DRV_INST(inst), prop, idx)
2141
2149#define DT_INST_PROP_OR(inst, prop, default_value) \
2150 DT_PROP_OR(DT_DRV_INST(inst), prop, default_value)
2151
2157#define DT_INST_LABEL(inst) DT_INST_PROP(inst, label)
2158
2167#define DT_INST_PROP_BY_PHANDLE(inst, ph, prop) \
2168 DT_INST_PROP_BY_PHANDLE_IDX(inst, ph, 0, prop)
2169
2181#define DT_INST_PROP_BY_PHANDLE_IDX(inst, phs, idx, prop) \
2182 DT_PROP_BY_PHANDLE_IDX(DT_DRV_INST(inst), phs, idx, prop)
2183
2192#define DT_INST_PHA_BY_IDX(inst, pha, idx, cell) \
2193 DT_PHA_BY_IDX(DT_DRV_INST(inst), pha, idx, cell)
2194
2204#define DT_INST_PHA_BY_IDX_OR(inst, pha, idx, cell, default_value) \
2205 DT_PHA_BY_IDX_OR(DT_DRV_INST(inst), pha, idx, cell, default_value)
2206
2215#define DT_INST_PHA(inst, pha, cell) DT_INST_PHA_BY_IDX(inst, pha, 0, cell)
2216
2225#define DT_INST_PHA_OR(inst, pha, cell, default_value) \
2226 DT_INST_PHA_BY_IDX_OR(inst, pha, 0, cell, default_value)
2227
2237#define DT_INST_PHA_BY_NAME(inst, pha, name, cell) \
2238 DT_PHA_BY_NAME(DT_DRV_INST(inst), pha, name, cell)
2239
2249#define DT_INST_PHA_BY_NAME_OR(inst, pha, name, cell, default_value) \
2250 DT_PHA_BY_NAME_OR(DT_DRV_INST(inst), pha, name, cell, default_value)
2251
2260#define DT_INST_PHANDLE_BY_NAME(inst, pha, name) \
2261 DT_PHANDLE_BY_NAME(DT_DRV_INST(inst), pha, name) \
2262
2272#define DT_INST_PHANDLE_BY_IDX(inst, prop, idx) \
2273 DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), prop, idx)
2274
2283#define DT_INST_PHANDLE(inst, prop) DT_INST_PHANDLE_BY_IDX(inst, prop, 0)
2284
2292#define DT_INST_REG_HAS_IDX(inst, idx) DT_REG_HAS_IDX(DT_DRV_INST(inst), idx)
2293
2300#define DT_INST_REG_ADDR_BY_IDX(inst, idx) DT_REG_ADDR_BY_IDX(DT_DRV_INST(inst), idx)
2301
2308#define DT_INST_REG_SIZE_BY_IDX(inst, idx) \
2309 DT_REG_SIZE_BY_IDX(DT_DRV_INST(inst), idx)
2310
2317#define DT_INST_REG_ADDR_BY_NAME(inst, name) \
2318 DT_REG_ADDR_BY_NAME(DT_DRV_INST(inst), name)
2319
2326#define DT_INST_REG_SIZE_BY_NAME(inst, name) \
2327 DT_REG_SIZE_BY_NAME(DT_DRV_INST(inst), name)
2328
2334#define DT_INST_REG_ADDR(inst) DT_INST_REG_ADDR_BY_IDX(inst, 0)
2335
2341#define DT_INST_REG_SIZE(inst) DT_INST_REG_SIZE_BY_IDX(inst, 0)
2342
2350#define DT_INST_IRQ_BY_IDX(inst, idx, cell) \
2351 DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell)
2352
2360#define DT_INST_IRQ_BY_NAME(inst, name, cell) \
2361 DT_IRQ_BY_NAME(DT_DRV_INST(inst), name, cell)
2362
2369#define DT_INST_IRQ(inst, cell) DT_INST_IRQ_BY_IDX(inst, 0, cell)
2370
2376#define DT_INST_IRQN(inst) DT_INST_IRQ(inst, irq)
2377
2383#define DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst))
2384
2390#define DT_INST_BUS_LABEL(inst) DT_BUS_LABEL(DT_DRV_INST(inst))
2391
2399#define DT_INST_ON_BUS(inst, bus) DT_ON_BUS(DT_DRV_INST(inst), bus)
2400
2429#define DT_ANY_INST_ON_BUS_STATUS_OKAY(bus) \
2430 DT_COMPAT_ON_BUS_INTERNAL(DT_DRV_COMPAT, bus)
2431
2491#define DT_INST_FOREACH_STATUS_OKAY(fn) \
2492 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
2493 (UTIL_CAT(DT_FOREACH_OKAY_INST_, \
2494 DT_DRV_COMPAT)(fn)), \
2495 ())
2496
2508#define DT_INST_FOREACH_STATUS_OKAY_VARGS(fn, ...) \
2509 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
2510 (UTIL_CAT(DT_FOREACH_OKAY_INST_VARGS_, \
2511 DT_DRV_COMPAT)(fn, __VA_ARGS__)), \
2512 ())
2513
2524#define DT_INST_FOREACH_PROP_ELEM(inst, prop, fn) \
2525 DT_FOREACH_PROP_ELEM(DT_DRV_INST(inst), prop, fn)
2526
2541#define DT_INST_FOREACH_PROP_ELEM_VARGS(inst, prop, fn, ...) \
2542 DT_FOREACH_PROP_ELEM_VARGS(DT_DRV_INST(inst), prop, fn, __VA_ARGS__)
2543
2550#define DT_INST_NODE_HAS_PROP(inst, prop) \
2551 DT_NODE_HAS_PROP(DT_DRV_INST(inst), prop)
2552
2563#define DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, idx, cell) \
2564 DT_PHA_HAS_CELL_AT_IDX(DT_DRV_INST(inst), pha, idx, cell)
2565
2575#define DT_INST_PHA_HAS_CELL(inst, pha, cell) \
2576 DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, 0, cell)
2577
2585#define DT_INST_IRQ_HAS_IDX(inst, idx) DT_IRQ_HAS_IDX(DT_DRV_INST(inst), idx)
2586
2595#define DT_INST_IRQ_HAS_CELL_AT_IDX(inst, idx, cell) \
2596 DT_IRQ_HAS_CELL_AT_IDX(DT_DRV_INST(inst), idx, cell)
2597
2605#define DT_INST_IRQ_HAS_CELL(inst, cell) \
2606 DT_INST_IRQ_HAS_CELL_AT_IDX(inst, 0, cell)
2607
2614#define DT_INST_IRQ_HAS_NAME(inst, name) \
2615 DT_IRQ_HAS_NAME(DT_DRV_INST(inst), name)
2616
2622#define DT_PATH_INTERNAL(...) \
2623 UTIL_CAT(DT_ROOT, MACRO_MAP_CAT(DT_S_PREFIX, __VA_ARGS__))
2625#define DT_S_PREFIX(name) _S_##name
2626
2641#define DT_CAT(a1, a2) a1 ## a2
2643#define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
2645#define DT_CAT4(a1, a2, a3, a4) a1 ## a2 ## a3 ## a4
2647#define DT_CAT5(a1, a2, a3, a4, a5) a1 ## a2 ## a3 ## a4 ## a5
2649#define DT_CAT6(a1, a2, a3, a4, a5, a6) a1 ## a2 ## a3 ## a4 ## a5 ## a6
2650/*
2651 * If you need to define a bigger DT_CATN(), do so here. Don't leave
2652 * any "holes" of undefined macros, please.
2653 */
2654
2656#define DT_DASH(...) MACRO_MAP_CAT(DT_DASH_PREFIX, __VA_ARGS__)
2658#define DT_DASH_PREFIX(name) _##name
2660#define DT_NODE_HAS_STATUS_INTERNAL(node_id, status) \
2661 IS_ENABLED(DT_CAT(node_id, _STATUS_ ## status))
2663#define DT_COMPAT_ON_BUS_INTERNAL(compat, bus) \
2664 IS_ENABLED(UTIL_CAT(DT_CAT(DT_COMPAT_, compat), _BUS_##bus))
2665
2666/* have these last so they have access to all previously defined macros */
2667#include <devicetree/io-channels.h>
2668#include <devicetree/clocks.h>
2669#include <devicetree/gpio.h>
2670#include <devicetree/spi.h>
2671#include <devicetree/dma.h>
2672#include <devicetree/pwms.h>
2674#include <devicetree/zephyr.h>
2675#include <devicetree/ordinals.h>
2676#include <devicetree/pinctrl.h>
2677
2678#endif /* DEVICETREE_H */
Clocks Devicetree macro public API header file.
DMA Devicetree macro public API header file.
GPIO Devicetree macro public API header file.
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.
Devicetree pin control helpers.
PWMs Devicetree macro public API header file.
Misc utilities.