Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
Macros | |
#define | DT_CLOCKS_HAS_IDX(node_id, idx) DT_PROP_HAS_IDX(node_id, clocks, idx) |
Test if a node has a clocks phandle-array property at a given index. | |
#define | DT_CLOCKS_HAS_NAME(node_id, name) DT_PROP_HAS_NAME(node_id, clocks, name) |
Test if a node has a clock-names array property holds a given name. | |
#define | DT_NUM_CLOCKS(node_id) DT_PROP_LEN(node_id, clocks) |
Get the number of elements in a clocks property. | |
#define | DT_CLOCKS_CTLR_BY_IDX(node_id, idx) DT_PHANDLE_BY_IDX(node_id, clocks, idx) |
Get the node identifier for the controller phandle from a "clocks" phandle-array property at an index. | |
#define | DT_CLOCKS_CTLR(node_id) DT_CLOCKS_CTLR_BY_IDX(node_id, 0) |
Equivalent to DT_CLOCKS_CTLR_BY_IDX(node_id, 0) | |
#define | DT_CLOCKS_CTLR_BY_NAME(node_id, name) DT_PHANDLE_BY_NAME(node_id, clocks, name) |
Get the node identifier for the controller phandle from a clocks phandle-array property by name. | |
#define | DT_CLOCKS_CELL_BY_IDX(node_id, idx, cell) DT_PHA_BY_IDX(node_id, clocks, idx, cell) |
Get a clock specifier's cell value at an index. | |
#define | DT_CLOCKS_CELL_BY_NAME(node_id, name, cell) DT_PHA_BY_NAME(node_id, clocks, name, cell) |
Get a clock specifier's cell value by name. | |
#define | DT_CLOCKS_CELL(node_id, cell) DT_CLOCKS_CELL_BY_IDX(node_id, 0, cell) |
Equivalent to DT_CLOCKS_CELL_BY_IDX(node_id, 0, cell) | |
#define | DT_INST_CLOCKS_HAS_IDX(inst, idx) DT_CLOCKS_HAS_IDX(DT_DRV_INST(inst), idx) |
Equivalent to DT_CLOCKS_HAS_IDX(DT_DRV_INST(inst), idx) | |
#define | DT_INST_CLOCKS_HAS_NAME(inst, name) DT_CLOCKS_HAS_NAME(DT_DRV_INST(inst), name) |
Equivalent to DT_CLOCK_HAS_NAME(DT_DRV_INST(inst), name) | |
#define | DT_INST_NUM_CLOCKS(inst) DT_NUM_CLOCKS(DT_DRV_INST(inst)) |
Equivalent to DT_NUM_CLOCKS(DT_DRV_INST(inst)) | |
#define | DT_INST_CLOCKS_CTLR_BY_IDX(inst, idx) DT_CLOCKS_CTLR_BY_IDX(DT_DRV_INST(inst), idx) |
Get the node identifier for the controller phandle from a "clocks" phandle-array property at an index. | |
#define | DT_INST_CLOCKS_CTLR(inst) DT_INST_CLOCKS_CTLR_BY_IDX(inst, 0) |
Equivalent to DT_INST_CLOCKS_CTLR_BY_IDX(inst, 0) | |
#define | DT_INST_CLOCKS_CTLR_BY_NAME(inst, name) DT_CLOCKS_CTLR_BY_NAME(DT_DRV_INST(inst), name) |
Get the node identifier for the controller phandle from a clocks phandle-array property by name. | |
#define | DT_INST_CLOCKS_CELL_BY_IDX(inst, idx, cell) DT_CLOCKS_CELL_BY_IDX(DT_DRV_INST(inst), idx, cell) |
Get a DT_DRV_COMPAT instance's clock specifier's cell value at an index. | |
#define | DT_INST_CLOCKS_CELL_BY_NAME(inst, name, cell) DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), name, cell) |
Get a DT_DRV_COMPAT instance's clock specifier's cell value by name. | |
#define | DT_INST_CLOCKS_CELL(inst, cell) DT_INST_CLOCKS_CELL_BY_IDX(inst, 0, cell) |
Equivalent to DT_INST_CLOCKS_CELL_BY_IDX(inst, 0, cell) | |
#define DT_CLOCKS_CELL | ( | node_id, | |
cell | |||
) | DT_CLOCKS_CELL_BY_IDX(node_id, 0, cell) |
#include <zephyr/devicetree/clocks.h>
Equivalent to DT_CLOCKS_CELL_BY_IDX(node_id, 0, cell)
node_id | node identifier for a node with a clocks property |
cell | lowercase-and-underscores cell name |
#define DT_CLOCKS_CELL_BY_IDX | ( | node_id, | |
idx, | |||
cell | |||
) | DT_PHA_BY_IDX(node_id, clocks, idx, cell) |
#include <zephyr/devicetree/clocks.h>
Get a clock specifier's cell value at an index.
Example devicetree fragment:
clk1: clock-controller@... { compatible = "vnd,clock"; #clock-cells = < 2 >; }; n: node { clocks = < &clk1 10 20 >, < &clk1 30 40 >; };
Bindings fragment for the vnd,clock compatible:
clock-cells: - bus - bits
Example usage:
DT_CLOCKS_CELL_BY_IDX(DT_NODELABEL(n), 0, bus) // 10 DT_CLOCKS_CELL_BY_IDX(DT_NODELABEL(n), 1, bits) // 40
node_id | node identifier for a node with a clocks property |
idx | logical index into clocks property |
cell | lowercase-and-underscores cell name |
#define DT_CLOCKS_CELL_BY_NAME | ( | node_id, | |
name, | |||
cell | |||
) | DT_PHA_BY_NAME(node_id, clocks, name, cell) |
#include <zephyr/devicetree/clocks.h>
Get a clock specifier's cell value by name.
Example devicetree fragment:
clk1: clock-controller@... { compatible = "vnd,clock"; #clock-cells = < 2 >; }; n: node { clocks = < &clk1 10 20 >, < &clk1 30 40 >; clock-names = "alpha", "beta"; };
Bindings fragment for the vnd,clock compatible:
clock-cells: - bus - bits
Example usage:
DT_CLOCKS_CELL_BY_NAME(DT_NODELABEL(n), alpha, bus) // 10 DT_CLOCKS_CELL_BY_NAME(DT_NODELABEL(n), beta, bits) // 40
node_id | node identifier for a node with a clocks property |
name | lowercase-and-underscores name of a clocks element as defined by the node's clock-names property |
cell | lowercase-and-underscores cell name |
#define DT_CLOCKS_CTLR | ( | node_id | ) | DT_CLOCKS_CTLR_BY_IDX(node_id, 0) |
#include <zephyr/devicetree/clocks.h>
Equivalent to DT_CLOCKS_CTLR_BY_IDX(node_id, 0)
node_id | node identifier |
#define DT_CLOCKS_CTLR_BY_IDX | ( | node_id, | |
idx | |||
) | DT_PHANDLE_BY_IDX(node_id, clocks, idx) |
#include <zephyr/devicetree/clocks.h>
Get the node identifier for the controller phandle from a "clocks" phandle-array property at an index.
Example devicetree fragment:
clk1: clock-controller@... { ... }; clk2: clock-controller@... { ... }; n: node { clocks = <&clk1 10 20>, <&clk2 30 40>; };
Example usage:
DT_CLOCKS_CTLR_BY_IDX(DT_NODELABEL(n), 0)) // DT_NODELABEL(clk1) DT_CLOCKS_CTLR_BY_IDX(DT_NODELABEL(n), 1)) // DT_NODELABEL(clk2)
node_id | node identifier |
idx | logical index into "clocks" |
#define DT_CLOCKS_CTLR_BY_NAME | ( | node_id, | |
name | |||
) | DT_PHANDLE_BY_NAME(node_id, clocks, name) |
#include <zephyr/devicetree/clocks.h>
Get the node identifier for the controller phandle from a clocks phandle-array property by name.
Example devicetree fragment:
clk1: clock-controller@... { ... }; clk2: clock-controller@... { ... }; n: node { clocks = <&clk1 10 20>, <&clk2 30 40>; clock-names = "alpha", "beta"; };
Example usage:
DT_CLOCKS_CTLR_BY_NAME(DT_NODELABEL(n), beta) // DT_NODELABEL(clk2)
node_id | node identifier |
name | lowercase-and-underscores name of a clocks element as defined by the node's clock-names property |
#define DT_CLOCKS_HAS_IDX | ( | node_id, | |
idx | |||
) | DT_PROP_HAS_IDX(node_id, clocks, idx) |
#include <zephyr/devicetree/clocks.h>
Test if a node has a clocks phandle-array property at a given index.
This expands to 1 if the given index is valid clocks property phandle-array index. Otherwise, it expands to 0.
Example devicetree fragment:
n1: node-1 { clocks = <...>, <...>; }; n2: node-2 { clocks = <...>; };
Example usage:
DT_CLOCKS_HAS_IDX(DT_NODELABEL(n1), 0) // 1 DT_CLOCKS_HAS_IDX(DT_NODELABEL(n1), 1) // 1 DT_CLOCKS_HAS_IDX(DT_NODELABEL(n1), 2) // 0 DT_CLOCKS_HAS_IDX(DT_NODELABEL(n2), 1) // 0
node_id | node identifier; may or may not have any clocks property |
idx | index of a clocks property phandle-array whose existence to check |
#define DT_CLOCKS_HAS_NAME | ( | node_id, | |
name | |||
) | DT_PROP_HAS_NAME(node_id, clocks, name) |
#include <zephyr/devicetree/clocks.h>
Test if a node has a clock-names array property holds a given name.
This expands to 1 if the name is available as clocks-name array property cell. Otherwise, it expands to 0.
Example devicetree fragment:
n1: node-1 { clocks = <...>, <...>; clock-names = "alpha", "beta"; }; n2: node-2 { clocks = <...>; clock-names = "alpha"; };
Example usage:
DT_CLOCKS_HAS_NAME(DT_NODELABEL(n1), alpha) // 1 DT_CLOCKS_HAS_NAME(DT_NODELABEL(n1), beta) // 1 DT_CLOCKS_HAS_NAME(DT_NODELABEL(n2), beta) // 0
node_id | node identifier; may or may not have any clock-names property. |
name | lowercase-and-underscores clock-names cell value name to check |
#define DT_INST_CLOCKS_CELL | ( | inst, | |
cell | |||
) | DT_INST_CLOCKS_CELL_BY_IDX(inst, 0, cell) |
#include <zephyr/devicetree/clocks.h>
Equivalent to DT_INST_CLOCKS_CELL_BY_IDX(inst, 0, cell)
inst | DT_DRV_COMPAT instance number |
cell | lowercase-and-underscores cell name |
#define DT_INST_CLOCKS_CELL_BY_IDX | ( | inst, | |
idx, | |||
cell | |||
) | DT_CLOCKS_CELL_BY_IDX(DT_DRV_INST(inst), idx, cell) |
#include <zephyr/devicetree/clocks.h>
Get a DT_DRV_COMPAT instance's clock specifier's cell value at an index.
inst | DT_DRV_COMPAT instance number |
idx | logical index into clocks property |
cell | lowercase-and-underscores cell name |
#define DT_INST_CLOCKS_CELL_BY_NAME | ( | inst, | |
name, | |||
cell | |||
) | DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), name, cell) |
#include <zephyr/devicetree/clocks.h>
Get a DT_DRV_COMPAT instance's clock specifier's cell value by name.
inst | DT_DRV_COMPAT instance number |
name | lowercase-and-underscores name of a clocks element as defined by the node's clock-names property |
cell | lowercase-and-underscores cell name |
#define DT_INST_CLOCKS_CTLR | ( | inst | ) | DT_INST_CLOCKS_CTLR_BY_IDX(inst, 0) |
#include <zephyr/devicetree/clocks.h>
Equivalent to DT_INST_CLOCKS_CTLR_BY_IDX(inst, 0)
inst | instance number |
#define DT_INST_CLOCKS_CTLR_BY_IDX | ( | inst, | |
idx | |||
) | DT_CLOCKS_CTLR_BY_IDX(DT_DRV_INST(inst), idx) |
#include <zephyr/devicetree/clocks.h>
Get the node identifier for the controller phandle from a "clocks" phandle-array property at an index.
inst | instance number |
idx | logical index into "clocks" |
#define DT_INST_CLOCKS_CTLR_BY_NAME | ( | inst, | |
name | |||
) | DT_CLOCKS_CTLR_BY_NAME(DT_DRV_INST(inst), name) |
#include <zephyr/devicetree/clocks.h>
Get the node identifier for the controller phandle from a clocks phandle-array property by name.
inst | instance number |
name | lowercase-and-underscores name of a clocks element as defined by the node's clock-names property |
#define DT_INST_CLOCKS_HAS_IDX | ( | inst, | |
idx | |||
) | DT_CLOCKS_HAS_IDX(DT_DRV_INST(inst), idx) |
#include <zephyr/devicetree/clocks.h>
Equivalent to DT_CLOCKS_HAS_IDX(DT_DRV_INST(inst), idx)
inst | DT_DRV_COMPAT instance number; may or may not have any clocks property |
idx | index of a clocks property phandle-array whose existence to check |
#define DT_INST_CLOCKS_HAS_NAME | ( | inst, | |
name | |||
) | DT_CLOCKS_HAS_NAME(DT_DRV_INST(inst), name) |
#include <zephyr/devicetree/clocks.h>
Equivalent to DT_CLOCK_HAS_NAME(DT_DRV_INST(inst), name)
inst | DT_DRV_COMPAT instance number; may or may not have any clock-names property. |
name | lowercase-and-underscores clock-names cell value name to check |
#define DT_INST_NUM_CLOCKS | ( | inst | ) | DT_NUM_CLOCKS(DT_DRV_INST(inst)) |
#include <zephyr/devicetree/clocks.h>
Equivalent to DT_NUM_CLOCKS(DT_DRV_INST(inst))
inst | instance number |
#define DT_NUM_CLOCKS | ( | node_id | ) | DT_PROP_LEN(node_id, clocks) |
#include <zephyr/devicetree/clocks.h>
Get the number of elements in a clocks property.
Example devicetree fragment:
n1: node-1 { clocks = <&foo>, <&bar>; }; n2: node-2 { clocks = <&foo>; };
Example usage:
DT_NUM_CLOCKS(DT_NODELABEL(n1)) // 2 DT_NUM_CLOCKS(DT_NODELABEL(n2)) // 1
node_id | node identifier with a clocks property |