Zephyr Project API 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Dependency tracking

Macros

#define DT_DEP_ORD(node_id)   DT_CAT(node_id, _ORD)
 Get a node's dependency ordinal.
 
#define DT_DEP_ORD_STR_SORTABLE(node_id)   DT_CAT(node_id, _ORD_STR_SORTABLE)
 Get a node's dependency ordinal in string sortable form.
 
#define DT_REQUIRES_DEP_ORDS(node_id)   DT_CAT(node_id, _REQUIRES_ORDS)
 Get a list of dependency ordinals of a node's direct dependencies.
 
#define DT_SUPPORTS_DEP_ORDS(node_id)   DT_CAT(node_id, _SUPPORTS_ORDS)
 Get a list of dependency ordinals of what depends directly on a node.
 
#define DT_INST_DEP_ORD(inst)   DT_DEP_ORD(DT_DRV_INST(inst))
 Get a DT_DRV_COMPAT instance's dependency ordinal.
 
#define DT_INST_REQUIRES_DEP_ORDS(inst)   DT_REQUIRES_DEP_ORDS(DT_DRV_INST(inst))
 Get a list of dependency ordinals of a DT_DRV_COMPAT instance's direct dependencies.
 
#define DT_INST_SUPPORTS_DEP_ORDS(inst)   DT_SUPPORTS_DEP_ORDS(DT_DRV_INST(inst))
 Get a list of dependency ordinals of what depends directly on a DT_DRV_COMPAT instance.
 

Detailed Description

Macro Definition Documentation

◆ DT_DEP_ORD

#define DT_DEP_ORD (   node_id)    DT_CAT(node_id, _ORD)

#include <include/zephyr/devicetree/ordinals.h>

Get a node's dependency ordinal.

Parameters
node_idNode identifier
Returns
the node's dependency ordinal as an integer literal

◆ DT_DEP_ORD_STR_SORTABLE

#define DT_DEP_ORD_STR_SORTABLE (   node_id)    DT_CAT(node_id, _ORD_STR_SORTABLE)

#include <include/zephyr/devicetree/ordinals.h>

Get a node's dependency ordinal in string sortable form.

Parameters
node_idNode identifier
Returns
the node's dependency ordinal as a zero-padded integer literal

◆ DT_INST_DEP_ORD

#define DT_INST_DEP_ORD (   inst)    DT_DEP_ORD(DT_DRV_INST(inst))

#include <include/zephyr/devicetree/ordinals.h>

Get a DT_DRV_COMPAT instance's dependency ordinal.

Equivalent to DT_DEP_ORD(DT_DRV_INST(inst)).

Parameters
instinstance number
Returns
The instance's dependency ordinal

◆ DT_INST_REQUIRES_DEP_ORDS

#define DT_INST_REQUIRES_DEP_ORDS (   inst)    DT_REQUIRES_DEP_ORDS(DT_DRV_INST(inst))

#include <include/zephyr/devicetree/ordinals.h>

Get a list of dependency ordinals of a DT_DRV_COMPAT instance's direct dependencies.

Equivalent to DT_REQUIRES_DEP_ORDS(DT_DRV_INST(inst)).

Parameters
instinstance number
Returns
a list of dependency ordinals for the nodes the instance depends on directly

◆ DT_INST_SUPPORTS_DEP_ORDS

#define DT_INST_SUPPORTS_DEP_ORDS (   inst)    DT_SUPPORTS_DEP_ORDS(DT_DRV_INST(inst))

#include <include/zephyr/devicetree/ordinals.h>

Get a list of dependency ordinals of what depends directly on a DT_DRV_COMPAT instance.

Equivalent to DT_SUPPORTS_DEP_ORDS(DT_DRV_INST(inst)).

Parameters
instinstance number
Returns
a list of node identifiers for the nodes that depend directly on the instance

◆ DT_REQUIRES_DEP_ORDS

#define DT_REQUIRES_DEP_ORDS (   node_id)    DT_CAT(node_id, _REQUIRES_ORDS)

#include <include/zephyr/devicetree/ordinals.h>

Get a list of dependency ordinals of a node's direct dependencies.

There is a comma after each ordinal in the expansion, including the last one:

DT_REQUIRES_DEP_ORDS(my_node) // required_ord_1, ..., required_ord_n,

The one case DT_REQUIRES_DEP_ORDS() expands to nothing is when given the root node identifier DT_ROOT as argument. The root has no direct dependencies; every other node at least depends on its parent.

Parameters
node_idNode identifier
Returns
a list of dependency ordinals, with each ordinal followed by a comma (,), or an empty expansion

◆ DT_SUPPORTS_DEP_ORDS

#define DT_SUPPORTS_DEP_ORDS (   node_id)    DT_CAT(node_id, _SUPPORTS_ORDS)

#include <include/zephyr/devicetree/ordinals.h>

Get a list of dependency ordinals of what depends directly on a node.

There is a comma after each ordinal in the expansion, including the last one:

DT_SUPPORTS_DEP_ORDS(my_node) // supported_ord_1, ..., supported_ord_n,

DT_SUPPORTS_DEP_ORDS() may expand to nothing. This happens when node_id refers to a leaf node that nothing else depends on.

Parameters
node_idNode identifier
Returns
a list of dependency ordinals, with each ordinal followed by a comma (,), or an empty expansion