Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
|
Macros | |
#define | DT_HWSPINLOCK_CTRL_BY_IDX(node_id, idx) |
Get the node identifier for the hardware spinlock controller from a hwlocks property by id. | |
#define | DT_HWSPINLOCK_CTRL_BY_NAME(node_id, name) |
Get the node identifier for the hardware spinlock controller from a hwlocks property by name. | |
#define | DT_HWSPINLOCK_ID_BY_NAME(node_id, name) |
Get a hardware spinlock id by name. | |
#define | DT_HWSPINLOCK_ID_BY_IDX(node_id, idx) |
Get a hardware spinlock id by index. |
#define DT_HWSPINLOCK_CTRL_BY_IDX | ( | node_id, | |
idx ) |
#include <zephyr/devicetree/hwspinlock.h>
Get the node identifier for the hardware spinlock controller from a hwlocks property by id.
Example devicetree fragment:
hwlock1: hwspinlock-controller@... { ... }; hwlock2: hwspinlock-controller@... { ... }; n: node { hwlocks = <&hwlock1 8>, <&hwlock2 1>; hwlock-names = "rd", "wr"; };
Example usage:
DT_HWSPINLOCK_CTRL_BY_IDX(DT_NODELABEL(n), 0) // DT_NODELABEL(hwlock1) DT_HWSPINLOCK_CTRL_BY_IDX(DT_NODELABEL(n), 1) // DT_NODELABEL(hwlock2)
node_id | node identifier for a node with a hwlocks property |
idx | index of a hwlocks element in the hwlocks |
#define DT_HWSPINLOCK_CTRL_BY_NAME | ( | node_id, | |
name ) |
#include <zephyr/devicetree/hwspinlock.h>
Get the node identifier for the hardware spinlock controller from a hwlocks property by name.
Example devicetree fragment:
hwlock1: hwspinlock-controller@... { ... }; hwlock2: hwspinlock-controller@... { ... }; n: node { hwlocks = <&hwlock1 8>, <&hwlock2 1>; hwlock-names = "rd", "wr"; };
Example usage:
DT_HWSPINLOCK_CTRL_BY_NAME(DT_NODELABEL(n), rd) // DT_NODELABEL(hwlock1) DT_HWSPINLOCK_CTRL_BY_NAME(DT_NODELABEL(n), wr) // DT_NODELABEL(hwlock2)
node_id | node identifier for a node with a hwlocks property |
name | lowercase-and-underscores name of a hwlocks element as defined by the node's hwlocks-names property |
#define DT_HWSPINLOCK_ID_BY_IDX | ( | node_id, | |
idx ) |
#include <zephyr/devicetree/hwspinlock.h>
Get a hardware spinlock id by index.
Example devicetree fragment:
hwlock1: hwspinlock-controller@... { #hwlock-cells = <1>; }; n: node { hwlocks = <&hwlock1 1>, <&hwlock1 6>; };
Example usage:
DT_HWSPINLOCK_ID_BY_IDX(DT_NODELABEL(n), 0) // 1 DT_HWSPINLOCK_ID_BY_IDX(DT_NODELABEL(n), 1) // 6
node_id | node identifier for a node with a hwlocks property |
idx | index of a hwlocks element in the hwlocks |
#define DT_HWSPINLOCK_ID_BY_NAME | ( | node_id, | |
name ) |
#include <zephyr/devicetree/hwspinlock.h>
Get a hardware spinlock id by name.
Example devicetree fragment:
hwlock1: hwspinlock-controller@... { #hwlock-cells = <1>; }; n: node { hwlocks = <&hwlock1 1>, <&hwlock1 6>; hwlock-names = "rd", "wr"; };
Bindings fragment for the hwspinlock compatible:
hwlock-cells: - id
Example usage:
DT_HWSPINLOCK_ID_BY_NAME(DT_NODELABEL(n), rd) // 1 DT_HWSPINLOCK_ID_BY_NAME(DT_NODELABEL(n), wr) // 6
node_id | node identifier for a node with a hwlocks property |
name | lowercase-and-underscores name of a hwlocks element as defined by the node's hwlock-names property |