Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Devicetree Display API

Macros

#define DT_ZEPHYR_DISPLAY(idx)
 Get display node identifier by logical index from "displays" property of node with compatible "zephyr,displays".
 
#define DT_ZEPHYR_DISPLAYS_COUNT
 Get number of zephyr displays.
 

Detailed Description

Macro Definition Documentation

◆ DT_ZEPHYR_DISPLAY

#define DT_ZEPHYR_DISPLAY ( idx)

#include <zephyr/devicetree/display.h>

Value:
DT_PHANDLE_BY_IDX(DT_COMPAT_GET_ANY_STATUS_OKAY(zephyr_displays), displays, idx)
#define DT_COMPAT_GET_ANY_STATUS_OKAY(compat)
Get a node identifier for a status okay node with a compatible.
Definition devicetree.h:479
#define DT_PHANDLE_BY_IDX(node_id, prop, idx)
Get a node identifier for a phandle in a property.
Definition devicetree.h:1785

Get display node identifier by logical index from "displays" property of node with compatible "zephyr,displays".

Example devicetree fragment:

displays_node: my-displays {
compatible = "zephyr,displays";
displays = <&n2 &n3>;
status = "okay";
};
n2: node-2 { ... };
n3: node-3 { ... };

Above, displays property has two elements:

  • index 0 has phandle &n2, which is node-2's phandle
  • index 1 has phandle &n3, which is node-3's phandle

Example usage:

DT_ZEPHYR_DISPLAY(0) // node identifier for display node node-2
DT_ZEPHYR_DISPLAY(1) // node identifier for display node node-3
#define DT_ZEPHYR_DISPLAY(idx)
Get display node identifier by logical index from "displays" property of node with compatible "zephyr...
Definition display.h:59
Parameters
idxlogical index of display node's phandle in "displays" property
Returns
display node identifier, DT_INVALID_NODE otherwise

◆ DT_ZEPHYR_DISPLAYS_COUNT

#define DT_ZEPHYR_DISPLAYS_COUNT

#include <zephyr/devicetree/display.h>

Value:
(DT_PROP_LEN(DT_COMPAT_GET_ANY_STATUS_OKAY(zephyr_displays), displays)), \
(DT_HAS_CHOSEN(zephyr_display)))
#define DT_HAS_CHOSEN(prop)
Test if the devicetree has a /chosen node.
Definition devicetree.h:2922
#define DT_HAS_COMPAT_STATUS_OKAY(compat)
Does the devicetree have a status okay node with a compatible?
Definition devicetree.h:3711
#define DT_PROP_LEN(node_id, prop)
Get a property's logical length.
Definition devicetree.h:796
#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:203

Get number of zephyr displays.

Returns
number of displays designated by "displays" property of "zephyr,displays" compatible node, if it exists, otherwise 1 if "zephyr,display" chosen property exists, 0 otherwise