Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Devicetree Partition API

Macros

#define DT_NODE_BY_PARTITION_LABEL(label)
 Get a node identifier for a partition with a given label property.
#define DT_HAS_PARTITION_LABEL(label)
 Test if a partition with a given label property exists.
#define DT_PARTITION_EXISTS(node_id)
 Test if zephyr,mapped-partition, fixed-partitions or fixed-subpartitions compatible node exists.
#define DT_PARTITION_ID(node_id)
 Get a numeric identifier for a partition.
#define DT_MEM_FROM_PARTITION(node_id)
 Get the node identifier of the NVM memory for a partition.
#define DT_MTD_FROM_PARTITION(node_id)
 Get the node identifier of the NVM controller for a partition.
#define DT_PARTITION_ADDR(node_id)
 Get the absolute address of a partition This macro can only be used with partitions of internal memory addressable by the CPU.

Detailed Description

Macro Definition Documentation

◆ DT_HAS_PARTITION_LABEL

#define DT_HAS_PARTITION_LABEL ( label)

#include <zephyr/devicetree/partitions.h>

Value:
#define DT_HAS_FIXED_PARTITION_LABEL(label)
Test if a fixed partition with a given label property exists.
Definition fixed-partitions.h:61
#define DT_HAS_MAPPED_PARTITION_LABEL(label)
Test if a mapped partition with a given label property exists.
Definition mapped-partition.h:70
#define UTIL_OR(a, b)
Like a || b, but does evaluation and short-circuiting at C preprocessor time.
Definition util_macro.h:455

Test if a partition with a given label property exists.

Parameters
labellowercase-and-underscores label property value
Returns
1 if the device has a "zephyr,mapped-partition" or "fixed-subpartitions" compatible, or parent has a "fixed-partitions" compatible, 0 otherwise.

◆ DT_MEM_FROM_PARTITION

#define DT_MEM_FROM_PARTITION ( node_id)

#include <zephyr/devicetree/partitions.h>

Value:
COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, zephyr_mapped_partition), \
#define DT_MEM_FROM_FIXED_PARTITION(node_id)
Get the node identifier of the flash memory for a partition.
Definition fixed-partitions.h:86
#define DT_NODE_HAS_COMPAT(node_id, compat)
Does a devicetree node match a compatible?
Definition devicetree.h:3936
#define DT_MEM_FROM_MAPPED_PARTITION(node_id)
Get the node identifier of the NVM memory for a partition.
Definition mapped-partition.h:94
#define COND_CODE_1(_flag, _if_1_code, _else_code)
Insert code depending on whether _flag expands to 1 or not.
Definition util_macro.h:209

Get the node identifier of the NVM memory for a partition.

Parameters
node_idnode identifier for a partition node
Returns
the node identifier of the internal memory that contains the partition node, or DT_INVALID_NODE if it doesn't exist.

◆ DT_MTD_FROM_PARTITION

#define DT_MTD_FROM_PARTITION ( node_id)

#include <zephyr/devicetree/partitions.h>

Value:
COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, zephyr_mapped_partition), \
#define DT_MTD_FROM_FIXED_PARTITION(node_id)
Get the node identifier of the flash controller for a partition.
Definition fixed-partitions.h:96
#define DT_MTD_FROM_MAPPED_PARTITION(node_id)
Get the node identifier of the NVM controller for a partition.
Definition mapped-partition.h:105

Get the node identifier of the NVM controller for a partition.

Parameters
node_idnode identifier for a partition node
Returns
the node identifier of the memory technology device that contains the partition node.

◆ DT_NODE_BY_PARTITION_LABEL

#define DT_NODE_BY_PARTITION_LABEL ( label)

#include <zephyr/devicetree/partitions.h>

Value:
#define DT_NODE_BY_FIXED_PARTITION_LABEL(label)
Get a node identifier for a fixed partition with a given label property.
Definition fixed-partitions.h:52
#define DT_NODE_BY_MAPPED_PARTITION_LABEL(label)
Get a node identifier for a mapped partition with a given label property.
Definition mapped-partition.h:62

Get a node identifier for a partition with a given label property.

Parameters
labellowercase-and-underscores label property value
Returns
a node identifier for the partition with that label property

◆ DT_PARTITION_ADDR

#define DT_PARTITION_ADDR ( node_id)

#include <zephyr/devicetree/partitions.h>

Value:
COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, zephyr_mapped_partition), \
#define DT_FIXED_PARTITION_ADDR(node_id)
Get the absolute address of a fixed partition.
Definition fixed-partitions.h:133
#define DT_MAPPED_PARTITION_ADDR(node_id)
Get the absolute address of a mapped partition.
Definition mapped-partition.h:141

Get the absolute address of a partition This macro can only be used with partitions of internal memory addressable by the CPU.

Otherwise, it may produce a compile-time error, such as: '__REG_IDX_0_VAL_ADDRESS' undeclared.

Parameters
node_idnode identifier for a partition node
Returns
the partition's unit address.

◆ DT_PARTITION_EXISTS

#define DT_PARTITION_EXISTS ( node_id)

#include <zephyr/devicetree/partitions.h>

Value:
#define DT_FIXED_SUBPARTITION_EXISTS(node_id)
Test if fixed-subpartitions compatible node exists.
Definition fixed-partitions.h:142
#define DT_FIXED_PARTITION_EXISTS(node_id)
Test if fixed-partition compatible node exists.
Definition fixed-partitions.h:70
#define DT_MAPPED_PARTITION_EXISTS(node_id)
Test if zephyr,mapped-partition compatible node exists.
Definition mapped-partition.h:79

Test if zephyr,mapped-partition, fixed-partitions or fixed-subpartitions compatible node exists.

Parameters
node_idDTS node to test
Returns
1 if node exists and has a "zephyr,mapped-partition" or "fixed-subpartitions" compatible, or if parent has a "fixed-partitions" compatible, 0 otherwise.

◆ DT_PARTITION_ID

#define DT_PARTITION_ID ( node_id)

#include <zephyr/devicetree/partitions.h>

Value:
COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, zephyr_mapped_partition), \
(DT_MAPPED_PARTITION_ID(node_id)), \
#define DT_FIXED_PARTITION_ID(node_id)
Get a numeric identifier for a fixed partition.
Definition fixed-partitions.h:78
#define DT_MAPPED_PARTITION_ID(node_id)
Get a numeric identifier for a mapped partition.
Definition mapped-partition.h:86

Get a numeric identifier for a partition.

Parameters
node_idnode identifier for a partition node
Returns
the partition's ID, a unique zero-based index number