Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Devicetree Reset Controller API

Macros

#define DT_RESET_CTLR_BY_IDX(node_id, idx)    DT_PHANDLE_BY_IDX(node_id, resets, idx)
 Get the node identifier for the controller phandle from a "resets" phandle-array property at an index.
 
#define DT_RESET_CTLR(node_id)    DT_RESET_CTLR_BY_IDX(node_id, 0)
 Equivalent to DT_RESET_CTLR_BY_IDX(node_id, 0)
 
#define DT_RESET_CTLR_BY_NAME(node_id, name)    DT_PHANDLE_BY_NAME(node_id, resets, 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)    DT_PHA_BY_IDX(node_id, resets, idx, cell)
 Get a reset specifier's cell value at an index.
 
#define DT_RESET_CELL_BY_NAME(node_id, name, cell)    DT_PHA_BY_NAME(node_id, resets, name, cell)
 Get a reset specifier's cell value by name.
 
#define DT_RESET_CELL(node_id, cell)    DT_RESET_CELL_BY_IDX(node_id, 0, cell)
 Equivalent to DT_RESET_CELL_BY_IDX(node_id, 0, cell)
 
#define DT_INST_RESET_CTLR_BY_IDX(inst, idx)    DT_RESET_CTLR_BY_IDX(DT_DRV_INST(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)    DT_INST_RESET_CTLR_BY_IDX(inst, 0)
 Equivalent to DT_INST_RESET_CTLR_BY_IDX(inst, 0)
 
#define DT_INST_RESET_CTLR_BY_NAME(inst, name)    DT_RESET_CTLR_BY_NAME(DT_DRV_INST(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)    DT_RESET_CELL_BY_IDX(DT_DRV_INST(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)    DT_RESET_CELL_BY_NAME(DT_DRV_INST(inst), name, cell)
 Get a DT_DRV_COMPAT instance's reset specifier's cell value by name.
 
#define DT_INST_RESET_CELL(inst, cell)    DT_INST_RESET_CELL_BY_IDX(inst, 0, cell)
 Equivalent to DT_INST_RESET_CELL_BY_IDX(inst, 0, cell)
 
#define DT_RESET_ID_BY_IDX(node_id, idx)    DT_PHA_BY_IDX(node_id, resets, idx, id)
 Get a Reset Controller specifier's id cell at an index.
 
#define DT_RESET_ID(node_id)    DT_RESET_ID_BY_IDX(node_id, 0)
 Equivalent to DT_RESET_ID_BY_IDX(node_id, 0)
 
#define DT_INST_RESET_ID_BY_IDX(inst, idx)    DT_RESET_ID_BY_IDX(DT_DRV_INST(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)    DT_INST_RESET_ID_BY_IDX(inst, 0)
 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 
)     DT_INST_RESET_CELL_BY_IDX(inst, 0, cell)

#include <zephyr/devicetree/reset.h>

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 
)     DT_RESET_CELL_BY_IDX(DT_DRV_INST(inst), idx, cell)

#include <zephyr/devicetree/reset.h>

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 
)     DT_RESET_CELL_BY_NAME(DT_DRV_INST(inst), name, cell)

#include <zephyr/devicetree/reset.h>

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)     DT_INST_RESET_CTLR_BY_IDX(inst, 0)

#include <zephyr/devicetree/reset.h>

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 
)     DT_RESET_CTLR_BY_IDX(DT_DRV_INST(inst), idx)

#include <zephyr/devicetree/reset.h>

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 
)     DT_RESET_CTLR_BY_NAME(DT_DRV_INST(inst), name)

#include <zephyr/devicetree/reset.h>

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)     DT_INST_RESET_ID_BY_IDX(inst, 0)

#include <zephyr/devicetree/reset.h>

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 
)     DT_RESET_ID_BY_IDX(DT_DRV_INST(inst), idx)

#include <zephyr/devicetree/reset.h>

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 
)     DT_RESET_CELL_BY_IDX(node_id, 0, cell)

#include <zephyr/devicetree/reset.h>

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 
)     DT_PHA_BY_IDX(node_id, resets, idx, cell)

#include <zephyr/devicetree/reset.h>

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 
)     DT_PHA_BY_NAME(node_id, resets, name, cell)

#include <zephyr/devicetree/reset.h>

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)     DT_RESET_CTLR_BY_IDX(node_id, 0)

#include <zephyr/devicetree/reset.h>

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 
)     DT_PHANDLE_BY_IDX(node_id, resets, idx)

#include <zephyr/devicetree/reset.h>

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 
)     DT_PHANDLE_BY_NAME(node_id, resets, name)

#include <zephyr/devicetree/reset.h>

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)     DT_RESET_ID_BY_IDX(node_id, 0)

#include <zephyr/devicetree/reset.h>

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 
)     DT_PHA_BY_IDX(node_id, resets, idx, id)

#include <zephyr/devicetree/reset.h>

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()