|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
Map devicetree macro public API header file. More...
Go to the source code of this file.
Macros | |
| #define | DT_NODE_HAS_MAP(node_id, prop) |
| Returns the existence of map property. | |
| #define | DT_MAP_LEN(node_id, prop) |
| Returns the number of maps for the given property. | |
| #define | DT_MAP_HAS_ENTRY_BY_IDX(node_id, prop, entry_idx) |
Is index idx valid for an array type property? | |
| #define | DT_MAP_HAS_ENTRY(node_id, prop) |
| Checks if the map property has any entries. | |
| #define | DT_MAP_ENTRY_CHILD_ADDRESS_LEN(node_id, prop, entry_idx) |
| Get the number of child addresses. | |
| #define | DT_MAP_ENTRY_HAS_CHILD_ADDRESS_BY_IDX(node_id, prop, entry_idx, param_idx) |
| Checks if the child address has the specified index. | |
| #define | DT_MAP_ENTRY_HAS_CHILD_ADDRESS(node_id, prop, entry_idx) |
| Checks if the mapping entry has any child addresses. | |
| #define | DT_MAP_ENTRY_CHILD_ADDRESS_BY_IDX(node_id, prop, entry_idx, param_idx) |
| Get the child address element from a mapping entry, by index. | |
| #define | DT_MAP_ENTRY_CHILD_ADDRESS(node_id, prop, entry_idx) |
| Get the first child address element from a mapping entry. | |
| #define | DT_MAP_ENTRY_CHILD_SPECIFIER_LEN(node_id, prop, entry_idx) |
| Get the number of child specifiers. | |
| #define | DT_MAP_ENTRY_HAS_CHILD_SPECIFIER_BY_IDX(node_id, prop, entry_idx, param_idx) |
| Checks if the child specifier has the specified index. | |
| #define | DT_MAP_ENTRY_HAS_CHILD_SPECIFIER(node_id, prop, entry_idx) |
| Checks if the mapping entry has any child specifiers. | |
| #define | DT_MAP_ENTRY_CHILD_SPECIFIER_BY_IDX(node_id, prop, entry_idx, param_idx) |
| Get the child specifier element from a mapping entry, by index. | |
| #define | DT_MAP_ENTRY_CHILD_SPECIFIER(node_id, prop, entry_idx) |
| Get the first child specifier element from a mapping entry. | |
| #define | DT_MAP_ENTRY_PARENT_BY_IDX(node_id, prop, entry_idx) |
| Extracts the parent node from a mapping entry. | |
| #define | DT_MAP_ENTRY_PARENT(node_id, prop) |
| Extracts the parent node from the first mapping entry. | |
| #define | DT_MAP_ENTRY_PARENT_ADDRESS_LEN(node_id, prop, entry_idx) |
| Get the number of parent addresses. | |
| #define | DT_MAP_ENTRY_HAS_PARENT_ADDRESS_BY_IDX(node_id, prop, entry_idx, param_idx) |
| Checks if the parent address has the specified index. | |
| #define | DT_MAP_ENTRY_HAS_PARENT_ADDRESS(node_id, prop, entry_idx) |
| Checks if the mapping entry has any parent addresses. | |
| #define | DT_MAP_ENTRY_PARENT_ADDRESS_BY_IDX(node_id, prop, entry_idx, param_idx) |
| Get the parent address element from a mapping entry, by index. | |
| #define | DT_MAP_ENTRY_PARENT_ADDRESS(node_id, prop, entry_idx) |
| Get the first parent address element from a mapping entry. | |
| #define | DT_MAP_ENTRY_PARENT_SPECIFIER_LEN(node_id, prop, entry_idx) |
| Get the number of parent specifiers. | |
| #define | DT_MAP_ENTRY_HAS_PARENT_SPECIFIER_BY_IDX(node_id, prop, entry_idx, param_idx) |
| Checks if the parent specifier has the specified index. | |
| #define | DT_MAP_ENTRY_HAS_PARENT_SPECIFIER(node_id, prop, entry_idx) |
| Checks if the mapping entry has any parent specifiers. | |
| #define | DT_MAP_ENTRY_PARENT_SPECIFIER_BY_IDX(node_id, prop, entry_idx, param_idx) |
| Get the parent specifier element from a mapping entry, by index. | |
| #define | DT_MAP_ENTRY_PARENT_SPECIFIER(node_id, prop, entry_idx) |
| Get the first parent specifier element from a mapping entry. | |
| #define | DT_FOREACH_MAP_ENTRY(node_id, prop, fn) |
Invokes fn for each map entry in the map. | |
| #define | DT_FOREACH_MAP_ENTRY_SEP(node_id, prop, fn, sep) |
Invokes fn for each map entry in the map with separator. | |
| #define | DT_FOREACH_MAP_ENTRY_VARGS(node_id, prop, fn, ...) |
Invokes fn for each map entry in the map with separator. | |
| #define | DT_FOREACH_MAP_ENTRY_SEP_VARGS(node_id, prop, fn, sep, ...) |
Invokes fn for each map entry in the map with separator. | |
Map devicetree macro public API header file.
This module provides helper macros that facilitate interrupt mapping and specifier mapping based on DeviceTree specifications. It enables the extraction and interpretation of mapping data represented as phandle-arrays.
In a typical DeviceTree fragment, properties ending with "-map" specify:
For example, when the following DeviceTree snippet is defined:
In the first mapping entry:
The map API provides the following macros for access to specific parts of a mapping entry:
These macros extract, respectively, the child specifier arguments, the parent specifier arguments, and the parent node argument from a mapping element identified by its node ID, property name, and index.
For instance:
The above expansion yields: