Zephyr API 3.6.99
Loading...
Searching...
No Matches
Devicetree Reset Controller API

Macros

#define DT_RESET_CTLR_BY_IDX(node_id, idx)
 Get the node identifier for the controller phandle from a "resets" phandle-array property at an index.
 
#define DT_RESET_CTLR(node_id)
 Equivalent to DT_RESET_CTLR_BY_IDX(node_id, 0)
 
#define DT_RESET_CTLR_BY_NAME(node_id, name)
 Get the node identifier for the controller phandle from a resets phandle-array property by name.
 
#define DT_RESET_CELL_BY_IDX(node_id, idx, cell)
 Get a reset specifier's cell value at an index.
 
#define DT_RESET_CELL_BY_NAME(node_id, name, cell)
 Get a reset specifier's cell value by name.
 
#define DT_RESET_CELL(node_id, cell)
 Equivalent to DT_RESET_CELL_BY_IDX(node_id, 0, cell)
 
#define DT_INST_RESET_CTLR_BY_IDX(inst, idx)
 Get the node identifier for the controller phandle from a "resets" phandle-array property at an index.
 
#define DT_INST_RESET_CTLR(inst)
 Equivalent to DT_INST_RESET_CTLR_BY_IDX(inst, 0)
 
#define DT_INST_RESET_CTLR_BY_NAME(inst, name)
 Get the node identifier for the controller phandle from a resets phandle-array property by name.
 
#define DT_INST_RESET_CELL_BY_IDX(inst, idx, cell)
 Get a DT_DRV_COMPAT instance's reset specifier's cell value at an index.
 
#define DT_INST_RESET_CELL_BY_NAME(inst, name, cell)
 Get a DT_DRV_COMPAT instance's reset specifier's cell value by name.
 
#define DT_INST_RESET_CELL(inst, cell)
 Equivalent to DT_INST_RESET_CELL_BY_IDX(inst, 0, cell)
 
#define DT_RESET_ID_BY_IDX(node_id, idx)
 Get a Reset Controller specifier's id cell at an index.
 
#define DT_RESET_ID(node_id)
 Equivalent to DT_RESET_ID_BY_IDX(node_id, 0)
 
#define DT_INST_RESET_ID_BY_IDX(inst, idx)
 Get a DT_DRV_COMPAT instance's Reset Controller specifier's id cell value at an index.
 
#define DT_INST_RESET_ID(inst)
 Equivalent to DT_INST_RESET_ID_BY_IDX(inst, 0)
 

Detailed Description

Macro Definition Documentation

◆ DT_INST_RESET_CELL

#define DT_INST_RESET_CELL ( inst,
cell )

#include <zephyr/devicetree/reset.h>

Value:
#define DT_INST_RESET_CELL_BY_IDX(inst, idx, cell)
Get a DT_DRV_COMPAT instance's reset specifier's cell value at an index.
Definition reset.h:214

Equivalent to DT_INST_RESET_CELL_BY_IDX(inst, 0, cell)

Parameters
instDT_DRV_COMPAT instance number
celllowercase-and-underscores cell name
Returns
the value of the cell inside the specifier at index 0

◆ DT_INST_RESET_CELL_BY_IDX

#define DT_INST_RESET_CELL_BY_IDX ( inst,
idx,
cell )

#include <zephyr/devicetree/reset.h>

Value:
#define DT_DRV_INST(inst)
Node identifier for an instance of a DT_DRV_COMPAT compatible.
Definition devicetree.h:3623
#define DT_RESET_CELL_BY_IDX(node_id, idx, cell)
Get a reset specifier's cell value at an index.
Definition reset.h:121

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

Parameters
instDT_DRV_COMPAT instance number
idxlogical index into resets property
celllowercase-and-underscores cell name
Returns
the cell value at index "idx"
See also
DT_RESET_CELL_BY_IDX()

◆ DT_INST_RESET_CELL_BY_NAME

#define DT_INST_RESET_CELL_BY_NAME ( inst,
name,
cell )

#include <zephyr/devicetree/reset.h>

Value:
#define DT_RESET_CELL_BY_NAME(node_id, name, cell)
Get a reset specifier's cell value by name.
Definition reset.h:155

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

Parameters
instDT_DRV_COMPAT instance number
namelowercase-and-underscores name of a resets element as defined by the node's reset-names property
celllowercase-and-underscores cell name
Returns
the cell value in the specifier at the named element
See also
DT_RESET_CELL_BY_NAME()

◆ DT_INST_RESET_CTLR

#define DT_INST_RESET_CTLR ( inst)

#include <zephyr/devicetree/reset.h>

Value:
#define DT_INST_RESET_CTLR_BY_IDX(inst, idx)
Get the node identifier for the controller phandle from a "resets" phandle-array property at an index...
Definition reset.h:178

Equivalent to DT_INST_RESET_CTLR_BY_IDX(inst, 0)

Parameters
instinstance number
Returns
a node identifier for the reset controller at index 0 in "resets"
See also
DT_RESET_CTLR()

◆ DT_INST_RESET_CTLR_BY_IDX

#define DT_INST_RESET_CTLR_BY_IDX ( inst,
idx )

#include <zephyr/devicetree/reset.h>

Value:
#define DT_RESET_CTLR_BY_IDX(node_id, idx)
Get the node identifier for the controller phandle from a "resets" phandle-array property at an index...
Definition reset.h:50

Get the node identifier for the controller phandle from a "resets" phandle-array property at an index.

Parameters
instinstance number
idxlogical index into "resets"
Returns
the node identifier for the reset controller referenced at index "idx"
See also
DT_RESET_CTLR_BY_IDX()

◆ DT_INST_RESET_CTLR_BY_NAME

#define DT_INST_RESET_CTLR_BY_NAME ( inst,
name )

#include <zephyr/devicetree/reset.h>

Value:
#define DT_RESET_CTLR_BY_NAME(node_id, name)
Get the node identifier for the controller phandle from a resets phandle-array property by name.
Definition reset.h:89

Get the node identifier for the controller phandle from a resets phandle-array property by name.

Parameters
instinstance number
namelowercase-and-underscores name of a resets element as defined by the node's reset-names property
Returns
the node identifier for the reset controller referenced by the named element
See also
DT_RESET_CTLR_BY_NAME()

◆ DT_INST_RESET_ID

#define DT_INST_RESET_ID ( inst)

#include <zephyr/devicetree/reset.h>

Value:
#define DT_INST_RESET_ID_BY_IDX(inst, idx)
Get a DT_DRV_COMPAT instance's Reset Controller specifier's id cell value at an index.
Definition reset.h:289

Equivalent to DT_INST_RESET_ID_BY_IDX(inst, 0)

Parameters
instDT_DRV_COMPAT instance number
Returns
the id cell value at index 0
See also
DT_INST_RESET_ID_BY_IDX()

◆ DT_INST_RESET_ID_BY_IDX

#define DT_INST_RESET_ID_BY_IDX ( inst,
idx )

#include <zephyr/devicetree/reset.h>

Value:
#define DT_RESET_ID_BY_IDX(node_id, idx)
Get a Reset Controller specifier's id cell at an index.
Definition reset.h:269

Get a DT_DRV_COMPAT instance's Reset Controller specifier's id cell value at an index.

Parameters
instDT_DRV_COMPAT instance number
idxlogical index into "resets"
Returns
the id cell value at index "idx"
See also
DT_RESET_ID_BY_IDX()

◆ DT_RESET_CELL

#define DT_RESET_CELL ( node_id,
cell )

#include <zephyr/devicetree/reset.h>

Value:
DT_RESET_CELL_BY_IDX(node_id, 0, cell)

Equivalent to DT_RESET_CELL_BY_IDX(node_id, 0, cell)

Parameters
node_idnode identifier for a node with a resets property
celllowercase-and-underscores cell name
Returns
the cell value at index 0
See also
DT_RESET_CELL_BY_IDX()

◆ DT_RESET_CELL_BY_IDX

#define DT_RESET_CELL_BY_IDX ( node_id,
idx,
cell )

#include <zephyr/devicetree/reset.h>

Value:
DT_PHA_BY_IDX(node_id, resets, 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:1407

Get a reset specifier's cell value at an index.

Example devicetree fragment:

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

n: node {
        resets = <&reset 10>;
};

Bindings fragment for the vnd,reset compatible:

reset-cells:
  - id

Example usage:

DT_RESET_CELL_BY_IDX(DT_NODELABEL(n), 0, id) // 10
Parameters
node_idnode identifier for a node with a resets property
idxlogical index into resets property
celllowercase-and-underscores cell name
Returns
the cell value at index "idx"
See also
DT_PHA_BY_IDX()

◆ DT_RESET_CELL_BY_NAME

#define DT_RESET_CELL_BY_NAME ( node_id,
name,
cell )

#include <zephyr/devicetree/reset.h>

Value:
DT_PHA_BY_NAME(node_id, resets, 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:1502

Get a reset specifier's cell value by name.

Example devicetree fragment:

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

n: node {
        resets = <&reset 10>;
        reset-names = "alpha";
};

Bindings fragment for the vnd,reset compatible:

reset-cells:
  - id

Example usage:

DT_RESET_CELL_BY_NAME(DT_NODELABEL(n), alpha, id) // 10
Parameters
node_idnode identifier for a node with a resets property
namelowercase-and-underscores name of a resets element as defined by the node's reset-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_RESET_CTLR

#define DT_RESET_CTLR ( node_id)

#include <zephyr/devicetree/reset.h>

Value:

Equivalent to DT_RESET_CTLR_BY_IDX(node_id, 0)

Parameters
node_idnode identifier
Returns
a node identifier for the reset controller at index 0 in "resets"
See also
DT_RESET_CTLR_BY_IDX()

◆ DT_RESET_CTLR_BY_IDX

#define DT_RESET_CTLR_BY_IDX ( node_id,
idx )

#include <zephyr/devicetree/reset.h>

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

Get the node identifier for the controller phandle from a "resets" phandle-array property at an index.

Example devicetree fragment:

reset1: reset-controller@... { ... };

reset2: reset-controller@... { ... };

n: node {
        resets = <&reset1 10>, <&reset2 20>;
};

Example usage:

DT_RESET_CTLR_BY_IDX(DT_NODELABEL(n), 0)) // DT_NODELABEL(reset1)
DT_RESET_CTLR_BY_IDX(DT_NODELABEL(n), 1)) // DT_NODELABEL(reset2)
Parameters
node_idnode identifier
idxlogical index into "resets"
Returns
the node identifier for the reset controller referenced at index "idx"
See also
DT_PHANDLE_BY_IDX()

◆ DT_RESET_CTLR_BY_NAME

#define DT_RESET_CTLR_BY_NAME ( node_id,
name )

#include <zephyr/devicetree/reset.h>

Value:
DT_PHANDLE_BY_NAME(node_id, resets, 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:1576

Get the node identifier for the controller phandle from a resets phandle-array property by name.

Example devicetree fragment:

reset1: reset-controller@... { ... };

reset2: reset-controller@... { ... };

n: node {
        resets = <&reset1 10>, <&reset2 20>;
        reset-names = "alpha", "beta";
};

Example usage:

DT_RESET_CTLR_BY_NAME(DT_NODELABEL(n), alpha) // DT_NODELABEL(reset1)
DT_RESET_CTLR_BY_NAME(DT_NODELABEL(n), beta) // DT_NODELABEL(reset2)
Parameters
node_idnode identifier
namelowercase-and-underscores name of a resets element as defined by the node's reset-names property
Returns
the node identifier for the reset controller referenced by name
See also
DT_PHANDLE_BY_NAME()

◆ DT_RESET_ID

#define DT_RESET_ID ( node_id)

#include <zephyr/devicetree/reset.h>

Value:
DT_RESET_ID_BY_IDX(node_id, 0)

Equivalent to DT_RESET_ID_BY_IDX(node_id, 0)

Parameters
node_idnode identifier
Returns
the id cell value at index 0
See also
DT_RESET_ID_BY_IDX()

◆ DT_RESET_ID_BY_IDX

#define DT_RESET_ID_BY_IDX ( node_id,
idx )

#include <zephyr/devicetree/reset.h>

Value:
DT_PHA_BY_IDX(node_id, resets, idx, id)

Get a Reset Controller specifier's id cell at an index.

This macro only works for Reset Controller specifiers with cells named "id". Refer to the node's binding to check if necessary.

Example devicetree fragment:

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

n: node {
        resets = <&reset 10>;
};

Bindings fragment for the vnd,reset compatible:

reset-cells:
  - id

Example usage:

DT_RESET_ID_BY_IDX(DT_NODELABEL(n), 0) // 10
Parameters
node_idnode identifier
idxlogical index into "resets"
Returns
the id cell value at index "idx"
See also
DT_PHA_BY_IDX()