Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Devicetree Counter Alarms API

Macros

#define DT_COUNTER_ALARMS_CTLR_BY_IDX(node_id, counter_alarm_pha, idx)
 Get the node identifier for the counter controller from a counter-alarms property at an index.
#define DT_COUNTER_ALARMS_CTLR_BY_NAME(node_id, counter_alarm_pha, name)
 Get the node identifier for the counter controller from a counter-alarms property by name.
#define DT_COUNTER_ALARMS_CTLR(node_id, counter_alarm_pha)
 Equivalent to DT_COUNTER_ALARMS_CTLR_BY_IDX(node_id, counter_alarm_pha, 0).
#define DT_COUNTER_ALARMS_CELL_BY_IDX(node_id, counter_alarm_pha, idx, cell)
 Get counter alarm specifier's cell value at an index.
#define DT_COUNTER_ALARMS_CELL_BY_NAME(node_id, counter_alarm_pha, name, cell)
 Get a counter alarm specifier's cell value by name.
#define DT_COUNTER_ALARMS_CELL(node_id, counter_alarm_pha, cell)
 Equivalent to DT_COUNTER_ALARMS_CELL_BY_IDX(node_id, counter_alarm_pha, 0, cell).
#define DT_COUNTER_ALARMS_CHANNEL_BY_IDX(node_id, counter_alarm_pha, idx)
 Get a counter alarm specifier's channel cell value at an index.
#define DT_COUNTER_ALARMS_CHANNEL_BY_NAME(node_id, counter_alarm_pha, name)
 Get a counter alarm specifier's channel cell value by name.
#define DT_COUNTER_ALARMS_CHANNEL(node_id, counter_alarm_pha)
 Equivalent to DT_COUNTER_ALARMS_CHANNEL_BY_IDX(node_id, counter_alarm_pha, 0).
#define DT_INST_COUNTER_ALARMS_CTLR_BY_IDX(inst, counter_alarm_pha, idx)
 Get the node identifier for the counter controller from a DT_DRV_COMPAT instance's counter-alarms property at an index.
#define DT_INST_COUNTER_ALARMS_CTLR_BY_NAME(inst, counter_alarm_pha, name)
 Get the node identifier for the counter controller from a DT_DRV_COMPAT instance's counter-alarms property by name.
#define DT_INST_COUNTER_ALARMS_CTLR(inst, counter_alarm_pha)
 Equivalent to DT_INST_COUNTER_ALARMS_CTLR_BY_IDX(inst, counter_alarm_pha, 0).
#define DT_INST_COUNTER_ALARMS_CELL_BY_IDX(inst, counter_alarm_pha, idx, cell)
 Get a DT_DRV_COMPAT instance's counter alarm specifier's cell value at an index.
#define DT_INST_COUNTER_ALARMS_CELL_BY_NAME(inst, counter_alarm_pha, name, cell)
 Get a DT_DRV_COMPAT instance's counter alarm specifier's cell value by name.
#define DT_INST_COUNTER_ALARMS_CELL(inst, counter_alarm_pha, cell)
 Equivalent to DT_INST_COUNTER_ALARMS_CELL_BY_IDX(inst, counter_alarm_pha, 0, cell).
#define DT_INST_COUNTER_ALARMS_CHANNEL_BY_IDX(inst, counter_alarm_pha, idx)
 Equivalent to DT_INST_COUNTER_ALARMS_CELL_BY_IDX(inst, counter_alarm_pha, idx, channel).
#define DT_INST_COUNTER_ALARMS_CHANNEL_BY_NAME(inst, counter_alarm_pha, name)
 Equivalent to DT_INST_COUNTER_ALARMS_CELL_BY_NAME(inst, counter_alarm_pha, name, channel).
#define DT_INST_COUNTER_ALARMS_CHANNEL(inst, counter_alarm_pha)
 Equivalent to DT_INST_COUNTER_ALARMS_CHANNEL_BY_IDX(inst, counter_alarm_pha, 0).

Detailed Description

Macro Definition Documentation

◆ DT_COUNTER_ALARMS_CELL

#define DT_COUNTER_ALARMS_CELL ( node_id,
counter_alarm_pha,
cell )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_COUNTER_ALARMS_CELL_BY_IDX(node_id, counter_alarm_pha, 0, cell)
#define DT_COUNTER_ALARMS_CELL_BY_IDX(node_id, counter_alarm_pha, idx, cell)
Get counter alarm specifier's cell value at an index.
Definition counter-alarm.h:139

Equivalent to DT_COUNTER_ALARMS_CELL_BY_IDX(node_id, counter_alarm_pha, 0, cell).

Parameters
node_idnode identifier
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
celllowercase-and-underscores cell name
Returns
the cell value at index 0
See also
DT_COUNTER_ALARMS_CELL_BY_IDX()

◆ DT_COUNTER_ALARMS_CELL_BY_IDX

#define DT_COUNTER_ALARMS_CELL_BY_IDX ( node_id,
counter_alarm_pha,
idx,
cell )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_PHA_BY_IDX(node_id, counter_alarm_pha, idx, cell)
#define DT_PHA_BY_IDX(node_id, pha, idx, cell)
Get a phandle-array specifier cell value at an index.
Definition devicetree.h:1687

Get counter alarm specifier's cell value at an index.

Example devicetree fragment:

counter1: counter-controller@... {
        compatible = "vnd,counter";
        #counter-alarm-cells = <1>;
};

counter2: counter-controller@... {
        compatible = "vnd,counter";
        #counter-alarm-cells = <1>;
};

n: node {
        counter-alarms = <&counter1 1>, <&counter2 3>;
};

Bindings fragment for the "vnd,counter" compatible:

counter-alarm-cells:
  - channel

Example usage:

DT_COUNTER_ALARMS_CELL_BY_IDX(DT_NODELABEL(n), counter_alarms, 0, channel) // 1
DT_COUNTER_ALARMS_CELL_BY_IDX(DT_NODELABEL(n), counter_alarms, 1, channel) // 3
Parameters
node_idnode identifier
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
idxlogical index into counter_alarm_pha
celllowercase-and-underscores cell name
Returns
the cell value at index idx
See also
DT_PHA_BY_IDX()

◆ DT_COUNTER_ALARMS_CELL_BY_NAME

#define DT_COUNTER_ALARMS_CELL_BY_NAME ( node_id,
counter_alarm_pha,
name,
cell )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_PHA_BY_NAME(node_id, counter_alarm_pha, name, cell)
#define DT_PHA_BY_NAME(node_id, pha, name, cell)
Get a value within a phandle-array specifier by name.
Definition devicetree.h:1782

Get a counter alarm specifier's cell value by name.

Example devicetree fragment:

counter1: counter-controller@... {
        compatible = "vnd,counter";
        #counter-alarm-cells = <1>;
};

counter2: counter-controller@... {
        compatible = "vnd,counter";
        #counter-alarm-cells = <1>;
};

n: node {
        counter-alarms = <&counter1 1>, <&counter2 3>;
        counter-alarm-names = "alpha", "beta";
};

Bindings fragment for the "vnd,counter" compatible:

counter-alarm-cells:
  - channel

Example usage:

DT_COUNTER_ALARMS_CELL_BY_NAME(DT_NODELABEL(n), counter_alarms, alpha, channel) // 1
DT_COUNTER_ALARMS_CELL_BY_NAME(DT_NODELABEL(n), counter_alarms, beta, channel) // 3
Parameters
node_idnode identifier
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
namelowercase-and-underscores name of a counter-alarms element as defined by the node's counter-alarm-names property
celllowercase-and-underscores cell name
Returns
the cell value in the specifier at the named element
See also
DT_PHA_BY_NAME()

◆ DT_COUNTER_ALARMS_CHANNEL

#define DT_COUNTER_ALARMS_CHANNEL ( node_id,
counter_alarm_pha )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_COUNTER_ALARMS_CHANNEL_BY_IDX(node_id, counter_alarm_pha, 0)
#define DT_COUNTER_ALARMS_CHANNEL_BY_IDX(node_id, counter_alarm_pha, idx)
Get a counter alarm specifier's channel cell value at an index.
Definition counter-alarm.h:212

Equivalent to DT_COUNTER_ALARMS_CHANNEL_BY_IDX(node_id, counter_alarm_pha, 0).

Parameters
node_idnode identifier
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
Returns
the channel cell value at index 0
See also
DT_COUNTER_ALARMS_CHANNEL_BY_IDX()

◆ DT_COUNTER_ALARMS_CHANNEL_BY_IDX

#define DT_COUNTER_ALARMS_CHANNEL_BY_IDX ( node_id,
counter_alarm_pha,
idx )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_COUNTER_ALARMS_CELL_BY_IDX(node_id, counter_alarm_pha, idx, channel)

Get a counter alarm specifier's channel cell value at an index.

This macro only works for counter alarm specifiers with cells named channel. Refer to the node's binding to check if necessary.

This is equivalent to DT_COUNTER_ALARMS_CELL_BY_IDX(node_id, counter_alarm_pha, idx, channel).

Parameters
node_idnode identifier
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
idxlogical index into counter_alarm_pha
Returns
the channel cell value at index idx
See also
DT_COUNTER_ALARMS_CELL_BY_IDX()

◆ DT_COUNTER_ALARMS_CHANNEL_BY_NAME

#define DT_COUNTER_ALARMS_CHANNEL_BY_NAME ( node_id,
counter_alarm_pha,
name )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_COUNTER_ALARMS_CELL_BY_NAME(node_id, counter_alarm_pha, name, channel)
#define DT_COUNTER_ALARMS_CELL_BY_NAME(node_id, counter_alarm_pha, name, cell)
Get a counter alarm specifier's cell value by name.
Definition counter-alarm.h:181

Get a counter alarm specifier's channel cell value by name.

This macro only works for counter alarm specifiers with cells named channel. Refer to the node's binding to check if necessary.

This is equivalent to DT_COUNTER_ALARMS_CELL_BY_NAME(node_id, counter_alarm_pha, name, channel).

Parameters
node_idnode identifier
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
namelowercase-and-underscores name of a counter-alarms element as defined by the node's counter-alarm-names property
Returns
the channel cell value in the specifier at the named element
See also
DT_COUNTER_ALARMS_CELL_BY_NAME()

◆ DT_COUNTER_ALARMS_CTLR

#define DT_COUNTER_ALARMS_CTLR ( node_id,
counter_alarm_pha )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_COUNTER_ALARMS_CTLR_BY_IDX(node_id, counter_alarm_pha, 0)
#define DT_COUNTER_ALARMS_CTLR_BY_IDX(node_id, counter_alarm_pha, idx)
Get the node identifier for the counter controller from a counter-alarms property at an index.
Definition counter-alarm.h:54

Equivalent to DT_COUNTER_ALARMS_CTLR_BY_IDX(node_id, counter_alarm_pha, 0).

Parameters
node_idnode identifier
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
Returns
the node identifier for the counter controller at index 0 in counter_alarm_pha
See also
DT_COUNTER_ALARMS_CTLR_BY_IDX()

◆ DT_COUNTER_ALARMS_CTLR_BY_IDX

#define DT_COUNTER_ALARMS_CTLR_BY_IDX ( node_id,
counter_alarm_pha,
idx )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_PHANDLE_BY_IDX(node_id, counter_alarm_pha, idx)
#define DT_PHANDLE_BY_IDX(node_id, prop, idx)
Get a node identifier for a phandle in a property.
Definition devicetree.h:1908

Get the node identifier for the counter controller from a counter-alarms property at an index.

Example devicetree fragment:

counter1: counter-controller@... { ... };

counter2: counter-controller@... { ... };

n: node {
        counter-alarms = <&counter1 1>, <&counter2 3>;
};

Example usage:

DT_COUNTER_ALARMS_CTLR_BY_IDX(DT_NODELABEL(n), counter_alarms, 0)
    // DT_NODELABEL(counter1)
DT_COUNTER_ALARMS_CTLR_BY_IDX(DT_NODELABEL(n), counter_alarms, 1)
    // DT_NODELABEL(counter2)
Parameters
node_idnode identifier
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
idxlogical index into counter_alarm_pha
Returns
the node identifier for the counter controller referenced at index idx
See also
DT_PROP_BY_PHANDLE_IDX()

◆ DT_COUNTER_ALARMS_CTLR_BY_NAME

#define DT_COUNTER_ALARMS_CTLR_BY_NAME ( node_id,
counter_alarm_pha,
name )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_PHANDLE_BY_NAME(node_id, counter_alarm_pha, name)
#define DT_PHANDLE_BY_NAME(node_id, pha, name)
Get a phandle's node identifier from a phandle array by name.
Definition devicetree.h:1856

Get the node identifier for the counter controller from a counter-alarms property by name.

Example devicetree fragment:

counter1: counter-controller@... { ... };

counter2: counter-controller@... { ... };

n: node {
        counter-alarms = <&counter1 1>, <&counter2 3>;
        counter-alarm-names = "alpha", "beta";
};

Example usage:

DT_COUNTER_ALARMS_CTLR_BY_NAME(DT_NODELABEL(n), counter_alarms, alpha)
    // DT_NODELABEL(counter1)
DT_COUNTER_ALARMS_CTLR_BY_NAME(DT_NODELABEL(n), counter_alarms, beta)
    // DT_NODELABEL(counter2)
Parameters
node_idnode identifier
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
namelowercase-and-underscores name of a counter-alarms element as defined by the node's counter-alarm-names property
Returns
the node identifier for the counter controller in the named element
See also
DT_PHANDLE_BY_NAME()

◆ DT_INST_COUNTER_ALARMS_CELL

#define DT_INST_COUNTER_ALARMS_CELL ( inst,
counter_alarm_pha,
cell )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_INST_COUNTER_ALARMS_CELL_BY_IDX(inst, counter_alarm_pha, 0, cell)
#define DT_INST_COUNTER_ALARMS_CELL_BY_IDX(inst, counter_alarm_pha, idx, cell)
Get a DT_DRV_COMPAT instance's counter alarm specifier's cell value at an index.
Definition counter-alarm.h:299

Equivalent to DT_INST_COUNTER_ALARMS_CELL_BY_IDX(inst, counter_alarm_pha, 0, cell).

Parameters
instDT_DRV_COMPAT instance number
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
celllowercase-and-underscores cell name
Returns
the cell value at index 0
See also
DT_INST_COUNTER_ALARMS_CELL_BY_IDX()

◆ DT_INST_COUNTER_ALARMS_CELL_BY_IDX

#define DT_INST_COUNTER_ALARMS_CELL_BY_IDX ( inst,
counter_alarm_pha,
idx,
cell )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_COUNTER_ALARMS_CELL_BY_IDX(DT_DRV_INST(inst), counter_alarm_pha, idx, cell)
#define DT_DRV_INST(inst)
Node identifier for an instance of a DT_DRV_COMPAT compatible.
Definition devicetree.h:4765

Get a DT_DRV_COMPAT instance's counter alarm specifier's cell value at an index.

Parameters
instDT_DRV_COMPAT instance number
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
idxlogical index into counter_alarm_pha
celllowercase-and-underscores cell name
Returns
the cell value at index idx
See also
DT_COUNTER_ALARMS_CELL_BY_IDX()

◆ DT_INST_COUNTER_ALARMS_CELL_BY_NAME

#define DT_INST_COUNTER_ALARMS_CELL_BY_NAME ( inst,
counter_alarm_pha,
name,
cell )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_COUNTER_ALARMS_CELL_BY_NAME(DT_DRV_INST(inst), counter_alarm_pha, name, cell)

Get a DT_DRV_COMPAT instance's counter alarm specifier's cell value by name.

Parameters
instDT_DRV_COMPAT instance number
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
namelowercase-and-underscores name of a counter-alarms element as defined by the node's counter-alarm-names property
celllowercase-and-underscores cell name
Returns
the cell value in the specifier at the named element
See also
DT_COUNTER_ALARMS_CELL_BY_NAME()

◆ DT_INST_COUNTER_ALARMS_CHANNEL

#define DT_INST_COUNTER_ALARMS_CHANNEL ( inst,
counter_alarm_pha )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_INST_COUNTER_ALARMS_CHANNEL_BY_IDX(inst, counter_alarm_pha, 0)
#define DT_INST_COUNTER_ALARMS_CHANNEL_BY_IDX(inst, counter_alarm_pha, idx)
Equivalent to DT_INST_COUNTER_ALARMS_CELL_BY_IDX(inst, counter_alarm_pha, idx, channel).
Definition counter-alarm.h:340

Equivalent to DT_INST_COUNTER_ALARMS_CHANNEL_BY_IDX(inst, counter_alarm_pha, 0).

Parameters
instDT_DRV_COMPAT instance number
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
Returns
the channel cell value at index 0
See also
DT_INST_COUNTER_ALARMS_CHANNEL_BY_IDX()

◆ DT_INST_COUNTER_ALARMS_CHANNEL_BY_IDX

#define DT_INST_COUNTER_ALARMS_CHANNEL_BY_IDX ( inst,
counter_alarm_pha,
idx )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_INST_COUNTER_ALARMS_CELL_BY_IDX(inst, counter_alarm_pha, idx, channel)

Equivalent to DT_INST_COUNTER_ALARMS_CELL_BY_IDX(inst, counter_alarm_pha, idx, channel).

Parameters
instDT_DRV_COMPAT instance number
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
idxlogical index into counter_alarm_pha
Returns
the channel cell value at index idx
See also
DT_COUNTER_ALARMS_CHANNEL_BY_IDX()

◆ DT_INST_COUNTER_ALARMS_CHANNEL_BY_NAME

#define DT_INST_COUNTER_ALARMS_CHANNEL_BY_NAME ( inst,
counter_alarm_pha,
name )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_INST_COUNTER_ALARMS_CELL_BY_NAME(inst, counter_alarm_pha, name, channel)
#define DT_INST_COUNTER_ALARMS_CELL_BY_NAME(inst, counter_alarm_pha, name, cell)
Get a DT_DRV_COMPAT instance's counter alarm specifier's cell value by name.
Definition counter-alarm.h:315

Equivalent to DT_INST_COUNTER_ALARMS_CELL_BY_NAME(inst, counter_alarm_pha, name, channel).

Parameters
instDT_DRV_COMPAT instance number
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
namelowercase-and-underscores name of a counter-alarms element as defined by the node's counter-alarm-names property
Returns
the channel cell value in the specifier at the named element
See also
DT_COUNTER_ALARMS_CHANNEL_BY_NAME()

◆ DT_INST_COUNTER_ALARMS_CTLR

#define DT_INST_COUNTER_ALARMS_CTLR ( inst,
counter_alarm_pha )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_INST_COUNTER_ALARMS_CTLR_BY_IDX(inst, counter_alarm_pha, 0)
#define DT_INST_COUNTER_ALARMS_CTLR_BY_IDX(inst, counter_alarm_pha, idx)
Get the node identifier for the counter controller from a DT_DRV_COMPAT instance's counter-alarms pro...
Definition counter-alarm.h:258

Equivalent to DT_INST_COUNTER_ALARMS_CTLR_BY_IDX(inst, counter_alarm_pha, 0).

Parameters
instDT_DRV_COMPAT instance number
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
Returns
the node identifier for the counter controller at index 0
See also
DT_INST_COUNTER_ALARMS_CTLR_BY_IDX()

◆ DT_INST_COUNTER_ALARMS_CTLR_BY_IDX

#define DT_INST_COUNTER_ALARMS_CTLR_BY_IDX ( inst,
counter_alarm_pha,
idx )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_COUNTER_ALARMS_CTLR_BY_IDX(DT_DRV_INST(inst), counter_alarm_pha, idx)

Get the node identifier for the counter controller from a DT_DRV_COMPAT instance's counter-alarms property at an index.

Parameters
instDT_DRV_COMPAT instance number
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
idxlogical index into counter_alarm_pha
Returns
the node identifier for the counter controller referenced at index idx
See also
DT_COUNTER_ALARMS_CTLR_BY_IDX()

◆ DT_INST_COUNTER_ALARMS_CTLR_BY_NAME

#define DT_INST_COUNTER_ALARMS_CTLR_BY_NAME ( inst,
counter_alarm_pha,
name )

#include <zephyr/devicetree/counter-alarm.h>

Value:
DT_COUNTER_ALARMS_CTLR_BY_NAME(DT_DRV_INST(inst), counter_alarm_pha, name)
#define DT_COUNTER_ALARMS_CTLR_BY_NAME(node_id, counter_alarm_pha, name)
Get the node identifier for the counter controller from a counter-alarms property by name.
Definition counter-alarm.h:87

Get the node identifier for the counter controller from a DT_DRV_COMPAT instance's counter-alarms property by name.

Parameters
instDT_DRV_COMPAT instance number
counter_alarm_phalowercase-and-underscores counter alarm property with type "phandle-array"
namelowercase-and-underscores name of a counter-alarms element as defined by the node's counter-alarm-names property
Returns
the node identifier for the counter controller in the named element
See also
DT_COUNTER_ALARMS_CTLR_BY_NAME()