Zephyr API 3.6.99
Loading...
Searching...
No Matches
Devicetree IO Channels API

Macros

#define DT_IO_CHANNELS_CTLR_BY_IDX(node_id, idx)
 Get the node identifier for the node referenced by an io-channels property at an index.
 
#define DT_IO_CHANNELS_CTLR_BY_NAME(node_id, name)
 Get the node identifier for the node referenced by an io-channels property by name.
 
#define DT_IO_CHANNELS_CTLR(node_id)
 Equivalent to DT_IO_CHANNELS_CTLR_BY_IDX(node_id, 0)
 
#define DT_INST_IO_CHANNELS_CTLR_BY_IDX(inst, idx)
 Get the node identifier from a DT_DRV_COMPAT instance's io-channels property at an index.
 
#define DT_INST_IO_CHANNELS_CTLR_BY_NAME(inst, name)
 Get the node identifier from a DT_DRV_COMPAT instance's io-channels property by name.
 
#define DT_INST_IO_CHANNELS_CTLR(inst)
 Equivalent to DT_INST_IO_CHANNELS_CTLR_BY_IDX(inst, 0)
 
#define DT_IO_CHANNELS_INPUT_BY_IDX(node_id, idx)
 Get an io-channels specifier input cell at an index.
 
#define DT_IO_CHANNELS_INPUT_BY_NAME(node_id, name)
 Get an io-channels specifier input cell by name.
 
#define DT_IO_CHANNELS_INPUT(node_id)
 Equivalent to DT_IO_CHANNELS_INPUT_BY_IDX(node_id, 0)
 
#define DT_INST_IO_CHANNELS_INPUT_BY_IDX(inst, idx)
 Get an input cell from the "DT_DRV_INST(inst)" io-channels property at an index.
 
#define DT_INST_IO_CHANNELS_INPUT_BY_NAME(inst, name)
 Get an input cell from the "DT_DRV_INST(inst)" io-channels property by name.
 
#define DT_INST_IO_CHANNELS_INPUT(inst)
 Equivalent to DT_INST_IO_CHANNELS_INPUT_BY_IDX(inst, 0)
 

Detailed Description

Macro Definition Documentation

◆ DT_INST_IO_CHANNELS_CTLR

#define DT_INST_IO_CHANNELS_CTLR ( inst)

#include <zephyr/devicetree/io-channels.h>

Value:
#define DT_INST_IO_CHANNELS_CTLR_BY_IDX(inst, idx)
Get the node identifier from a DT_DRV_COMPAT instance's io-channels property at an index.
Definition io-channels.h:100

Equivalent to DT_INST_IO_CHANNELS_CTLR_BY_IDX(inst, 0)

Parameters
instDT_DRV_COMPAT instance number
Returns
the node identifier for the node referenced at index 0 in the node's "io-channels" property
See also
DT_IO_CHANNELS_CTLR_BY_IDX()

◆ DT_INST_IO_CHANNELS_CTLR_BY_IDX

#define DT_INST_IO_CHANNELS_CTLR_BY_IDX ( inst,
idx )

#include <zephyr/devicetree/io-channels.h>

Value:
#define DT_DRV_INST(inst)
Node identifier for an instance of a DT_DRV_COMPAT compatible.
Definition devicetree.h:3645
#define DT_IO_CHANNELS_CTLR_BY_IDX(node_id, idx)
Get the node identifier for the node referenced by an io-channels property at an index.
Definition io-channels.h:50

Get the node identifier from a DT_DRV_COMPAT instance's io-channels property at an index.

Parameters
instDT_DRV_COMPAT instance number
idxlogical index into io-channels property
Returns
the node identifier for the node referenced at index "idx"
See also
DT_IO_CHANNELS_CTLR_BY_IDX()

◆ DT_INST_IO_CHANNELS_CTLR_BY_NAME

#define DT_INST_IO_CHANNELS_CTLR_BY_NAME ( inst,
name )

#include <zephyr/devicetree/io-channels.h>

Value:
#define DT_IO_CHANNELS_CTLR_BY_NAME(node_id, name)
Get the node identifier for the node referenced by an io-channels property by name.
Definition io-channels.h:79

Get the node identifier from a DT_DRV_COMPAT instance's io-channels property by name.

Parameters
instDT_DRV_COMPAT instance number
namelowercase-and-underscores name of an io-channels element as defined by the node's io-channel-names property
Returns
the node identifier for the node referenced at the named element
See also
DT_IO_CHANNELS_CTLR_BY_NAME()

◆ DT_INST_IO_CHANNELS_INPUT

#define DT_INST_IO_CHANNELS_INPUT ( inst)

#include <zephyr/devicetree/io-channels.h>

Value:
#define DT_INST_IO_CHANNELS_INPUT_BY_IDX(inst, idx)
Get an input cell from the "DT_DRV_INST(inst)" io-channels property at an index.
Definition io-channels.h:221

Equivalent to DT_INST_IO_CHANNELS_INPUT_BY_IDX(inst, 0)

Parameters
instDT_DRV_COMPAT instance number
Returns
the input cell in the specifier at index 0

◆ DT_INST_IO_CHANNELS_INPUT_BY_IDX

#define DT_INST_IO_CHANNELS_INPUT_BY_IDX ( inst,
idx )

#include <zephyr/devicetree/io-channels.h>

Value:
#define DT_IO_CHANNELS_INPUT_BY_IDX(node_id, idx)
Get an io-channels specifier input cell at an index.
Definition io-channels.h:161

Get an input cell from the "DT_DRV_INST(inst)" io-channels property at an index.

Parameters
instDT_DRV_COMPAT instance number
idxlogical index into io-channels property
Returns
the input cell in the specifier at index "idx"
See also
DT_IO_CHANNELS_INPUT_BY_IDX()

◆ DT_INST_IO_CHANNELS_INPUT_BY_NAME

#define DT_INST_IO_CHANNELS_INPUT_BY_NAME ( inst,
name )

#include <zephyr/devicetree/io-channels.h>

Value:
#define DT_IO_CHANNELS_INPUT_BY_NAME(node_id, name)
Get an io-channels specifier input cell by name.
Definition io-channels.h:203

Get an input cell from the "DT_DRV_INST(inst)" io-channels property by name.

Parameters
instDT_DRV_COMPAT instance number
namelowercase-and-underscores name of an io-channels element as defined by the instance's io-channel-names property
Returns
the input cell in the specifier at the named element
See also
DT_IO_CHANNELS_INPUT_BY_NAME()

◆ DT_IO_CHANNELS_CTLR

#define DT_IO_CHANNELS_CTLR ( node_id)

#include <zephyr/devicetree/io-channels.h>

Value:

Equivalent to DT_IO_CHANNELS_CTLR_BY_IDX(node_id, 0)

Parameters
node_idnode identifier for a node with an io-channels property
Returns
the node identifier for the node referenced at index 0 in the node's "io-channels" property
See also
DT_IO_CHANNELS_CTLR_BY_IDX()

◆ DT_IO_CHANNELS_CTLR_BY_IDX

#define DT_IO_CHANNELS_CTLR_BY_IDX ( node_id,
idx )

#include <zephyr/devicetree/io-channels.h>

Value:
DT_PHANDLE_BY_IDX(node_id, io_channels, 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 node referenced by an io-channels property at an index.

Example devicetree fragment:

adc1: adc@... { ... };

adc2: adc@... { ... };

n: node {
        io-channels = <&adc1 10>, <&adc2 20>;
};

Example usage:

DT_IO_CHANNELS_CTLR_BY_IDX(DT_NODELABEL(n), 0) // DT_NODELABEL(adc1)
DT_IO_CHANNELS_CTLR_BY_IDX(DT_NODELABEL(n), 1) // DT_NODELABEL(adc2)
Parameters
node_idnode identifier for a node with an io-channels property
idxlogical index into io-channels property
Returns
the node identifier for the node referenced at index "idx"
See also
DT_PROP_BY_PHANDLE_IDX()

◆ DT_IO_CHANNELS_CTLR_BY_NAME

#define DT_IO_CHANNELS_CTLR_BY_NAME ( node_id,
name )

#include <zephyr/devicetree/io-channels.h>

Value:
DT_PHANDLE_BY_NAME(node_id, io_channels, 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 node referenced by an io-channels property by name.

Example devicetree fragment:

adc1: adc@... { ... };

adc2: adc@... { ... };

n: node {
        io-channels = <&adc1 10>, <&adc2 20>;
        io-channel-names = "SENSOR", "BANDGAP";
};

Example usage:

DT_IO_CHANNELS_CTLR_BY_NAME(DT_NODELABEL(n), sensor) // DT_NODELABEL(adc1) DT_IO_CHANNELS_CTLR_BY_NAME(DT_NODELABEL(n), bandgap) // DT_NODELABEL(adc2)

Parameters
node_idnode identifier for a node with an io-channels property
namelowercase-and-underscores name of an io-channels element as defined by the node's io-channel-names property
Returns
the node identifier for the node referenced at the named element
See also
DT_PHANDLE_BY_NAME()

◆ DT_IO_CHANNELS_INPUT

#define DT_IO_CHANNELS_INPUT ( node_id)

#include <zephyr/devicetree/io-channels.h>

Value:

Equivalent to DT_IO_CHANNELS_INPUT_BY_IDX(node_id, 0)

Parameters
node_idnode identifier for a node with an io-channels property
Returns
the input cell in the specifier at index 0
See also
DT_IO_CHANNELS_INPUT_BY_IDX()

◆ DT_IO_CHANNELS_INPUT_BY_IDX

#define DT_IO_CHANNELS_INPUT_BY_IDX ( node_id,
idx )

#include <zephyr/devicetree/io-channels.h>

Value:
DT_PHA_BY_IDX(node_id, io_channels, idx, input)
#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 an io-channels specifier input cell at an index.

This macro only works for io-channels specifiers with cells named "input". Refer to the node's binding to check if necessary.

Example devicetree fragment:

adc1: adc@... {
        compatible = "vnd,adc";
        #io-channel-cells = <1>;
};

adc2: adc@... {
        compatible = "vnd,adc";
        #io-channel-cells = <1>;
};

n: node {
        io-channels = <&adc1 10>, <&adc2 20>;
};

Bindings fragment for the vnd,adc compatible:

io-channel-cells:

  • input

Example usage:

DT_IO_CHANNELS_INPUT_BY_IDX(DT_NODELABEL(n), 0) // 10
DT_IO_CHANNELS_INPUT_BY_IDX(DT_NODELABEL(n), 1) // 20
Parameters
node_idnode identifier for a node with an io-channels property
idxlogical index into io-channels property
Returns
the input cell in the specifier at index "idx"
See also
DT_PHA_BY_IDX()

◆ DT_IO_CHANNELS_INPUT_BY_NAME

#define DT_IO_CHANNELS_INPUT_BY_NAME ( node_id,
name )

#include <zephyr/devicetree/io-channels.h>

Value:
DT_PHA_BY_NAME(node_id, io_channels, name, input)
#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 an io-channels specifier input cell by name.

This macro only works for io-channels specifiers with cells named "input". Refer to the node's binding to check if necessary.

Example devicetree fragment:

adc1: adc@... {
        compatible = "vnd,adc";
        #io-channel-cells = <1>;
};

adc2: adc@... {
        compatible = "vnd,adc";
        #io-channel-cells = <1>;
};

n: node {
        io-channels = <&adc1 10>, <&adc2 20>;
        io-channel-names = "SENSOR", "BANDGAP";
};

Bindings fragment for the vnd,adc compatible:

io-channel-cells:

  • input

Example usage:

DT_IO_CHANNELS_INPUT_BY_NAME(DT_NODELABEL(n), sensor) // 10
DT_IO_CHANNELS_INPUT_BY_NAME(DT_NODELABEL(n), bandgap) // 20
Parameters
node_idnode identifier for a node with an io-channels property
namelowercase-and-underscores name of an io-channels element as defined by the node's io-channel-names property
Returns
the input cell in the specifier at the named element
See also
DT_PHA_BY_NAME()