Zephyr API Documentation
4.4.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
partitions.h
Go to the documentation of this file.
1
5
6
/*
7
* Copyright (c) 2026 Nordic Semiconductor ASA.
8
*
9
* SPDX-License-Identifier: Apache-2.0
10
*/
11
12
#ifndef ZEPHYR_INCLUDE_DEVICETREE_PARTITIONS_H_
13
#define ZEPHYR_INCLUDE_DEVICETREE_PARTITIONS_H_
14
15
#include <
zephyr/sys/util_macro.h
>
16
#include <
zephyr/devicetree/mapped-partition.h
>
17
#include <
zephyr/devicetree/fixed-partitions.h
>
18
19
#ifdef __cplusplus
20
extern
"C"
{
21
#endif
22
28
35
#define DT_NODE_BY_PARTITION_LABEL(label) \
36
COND_CODE_1(DT_HAS_MAPPED_PARTITION_LABEL(label), \
37
(DT_NODE_BY_MAPPED_PARTITION_LABEL(label)), \
38
(DT_NODE_BY_FIXED_PARTITION_LABEL(label)))
39
46
#define DT_HAS_PARTITION_LABEL(label) \
47
UTIL_OR(DT_HAS_MAPPED_PARTITION_LABEL(label), DT_HAS_FIXED_PARTITION_LABEL(label))
48
57
#define DT_PARTITION_EXISTS(node_id) \
58
UTIL_OR(DT_MAPPED_PARTITION_EXISTS(node_id), \
59
UTIL_OR(DT_FIXED_PARTITION_EXISTS(node_id), \
60
DT_FIXED_SUBPARTITION_EXISTS(node_id)))
61
67
#define DT_PARTITION_ID(node_id) \
68
COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, zephyr_mapped_partition), \
69
(DT_MAPPED_PARTITION_ID(node_id)), \
70
(DT_FIXED_PARTITION_ID(node_id)))
71
78
#define DT_MEM_FROM_PARTITION(node_id) \
79
COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, zephyr_mapped_partition), \
80
(DT_MEM_FROM_MAPPED_PARTITION(node_id)), \
81
(DT_MEM_FROM_FIXED_PARTITION(node_id)))
82
88
#define DT_MTD_FROM_PARTITION(node_id) \
89
COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, zephyr_mapped_partition), \
90
(DT_MTD_FROM_MAPPED_PARTITION(node_id)), \
91
(DT_MTD_FROM_FIXED_PARTITION(node_id)))
92
102
#define DT_PARTITION_ADDR(node_id) \
103
COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, zephyr_mapped_partition), \
104
(DT_MAPPED_PARTITION_ADDR(node_id)), \
105
(DT_FIXED_PARTITION_ADDR(node_id)))
106
110
111
#ifdef __cplusplus
112
}
113
#endif
114
115
#endif
/* ZEPHYR_INCLUDE_DEVICETREE_PARTITIONS_H_ */
fixed-partitions.h
Flash Devicetree macro public API header file.
mapped-partition.h
Flash Devicetree macro public API header file, for memory-mapped partitions.
util_macro.h
Macro utilities.
zephyr
devicetree
partitions.h
Generated on
for Zephyr API Documentation by
1.16.1