Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Devicetree PWMs API

Macros

#define DT_PWMS_CTLR_BY_IDX(node_id, idx)
 Get the node identifier for the PWM controller from a pwms property at an index.
 
#define DT_PWMS_CTLR_BY_NAME(node_id, name)
 Get the node identifier for the PWM controller from a pwms property by name.
 
#define DT_PWMS_CTLR(node_id)
 Equivalent to DT_PWMS_CTLR_BY_IDX(node_id, 0)
 
#define DT_PWMS_CELL_BY_IDX(node_id, idx, cell)
 Get PWM specifier's cell value at an index.
 
#define DT_PWMS_CELL_BY_NAME(node_id, name, cell)
 Get a PWM specifier's cell value by name.
 
#define DT_PWMS_CELL(node_id, cell)
 Equivalent to DT_PWMS_CELL_BY_IDX(node_id, 0, cell)
 
#define DT_PWMS_CHANNEL_BY_IDX(node_id, idx)
 Get a PWM specifier's channel cell value at an index.
 
#define DT_PWMS_CHANNEL_BY_NAME(node_id, name)
 Get a PWM specifier's channel cell value by name.
 
#define DT_PWMS_CHANNEL(node_id)
 Equivalent to DT_PWMS_CHANNEL_BY_IDX(node_id, 0)
 
#define DT_PWMS_PERIOD_BY_IDX(node_id, idx)
 Get PWM specifier's period cell value at an index.
 
#define DT_PWMS_PERIOD_BY_NAME(node_id, name)
 Get a PWM specifier's period cell value by name.
 
#define DT_PWMS_PERIOD(node_id)
 Equivalent to DT_PWMS_PERIOD_BY_IDX(node_id, 0)
 
#define DT_PWMS_FLAGS_BY_IDX(node_id, idx)
 Get a PWM specifier's flags cell value at an index.
 
#define DT_PWMS_FLAGS_BY_NAME(node_id, name)
 Get a PWM specifier's flags cell value by name.
 
#define DT_PWMS_FLAGS(node_id)
 Equivalent to DT_PWMS_FLAGS_BY_IDX(node_id, 0)
 
#define DT_INST_PWMS_CTLR_BY_IDX(inst, idx)
 Get the node identifier for the PWM controller from a DT_DRV_COMPAT instance's pwms property at an index.
 
#define DT_INST_PWMS_CTLR_BY_NAME(inst, name)
 Get the node identifier for the PWM controller from a DT_DRV_COMPAT instance's pwms property by name.
 
#define DT_INST_PWMS_CTLR(inst)
 Equivalent to DT_INST_PWMS_CTLR_BY_IDX(inst, 0)
 
#define DT_INST_PWMS_CELL_BY_IDX(inst, idx, cell)
 Get a DT_DRV_COMPAT instance's PWM specifier's cell value at an index.
 
#define DT_INST_PWMS_CELL_BY_NAME(inst, name, cell)
 Get a DT_DRV_COMPAT instance's PWM specifier's cell value by name.
 
#define DT_INST_PWMS_CELL(inst, cell)
 Equivalent to DT_INST_PWMS_CELL_BY_IDX(inst, 0, cell)
 
#define DT_INST_PWMS_CHANNEL_BY_IDX(inst, idx)
 Equivalent to DT_INST_PWMS_CELL_BY_IDX(inst, idx, channel)
 
#define DT_INST_PWMS_CHANNEL_BY_NAME(inst, name)
 Equivalent to DT_INST_PWMS_CELL_BY_NAME(inst, name, channel)
 
#define DT_INST_PWMS_CHANNEL(inst)
 Equivalent to DT_INST_PWMS_CHANNEL_BY_IDX(inst, 0)
 
#define DT_INST_PWMS_PERIOD_BY_IDX(inst, idx)
 Equivalent to DT_INST_PWMS_CELL_BY_IDX(inst, idx, period)
 
#define DT_INST_PWMS_PERIOD_BY_NAME(inst, name)
 Equivalent to DT_INST_PWMS_CELL_BY_NAME(inst, name, period)
 
#define DT_INST_PWMS_PERIOD(inst)
 Equivalent to DT_INST_PWMS_PERIOD_BY_IDX(inst, 0)
 
#define DT_INST_PWMS_FLAGS_BY_IDX(inst, idx)
 Equivalent to DT_INST_PWMS_CELL_BY_IDX(inst, idx, flags)
 
#define DT_INST_PWMS_FLAGS_BY_NAME(inst, name)
 Equivalent to DT_INST_PWMS_CELL_BY_NAME(inst, name, flags)
 
#define DT_INST_PWMS_FLAGS(inst)
 Equivalent to DT_INST_PWMS_FLAGS_BY_IDX(inst, 0)
 

Detailed Description

Macro Definition Documentation

◆ DT_INST_PWMS_CELL

#define DT_INST_PWMS_CELL ( inst,
cell )

#include <zephyr/devicetree/pwms.h>

Value:
DT_INST_PWMS_CELL_BY_IDX(inst, 0, cell)
#define DT_INST_PWMS_CELL_BY_IDX(inst, idx, cell)
Get a DT_DRV_COMPAT instance's PWM specifier's cell value at an index.
Definition pwms.h:363

Equivalent to DT_INST_PWMS_CELL_BY_IDX(inst, 0, cell)

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

◆ DT_INST_PWMS_CELL_BY_IDX

#define DT_INST_PWMS_CELL_BY_IDX ( inst,
idx,
cell )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PWMS_CELL_BY_IDX(DT_DRV_INST(inst), idx, cell)
#define DT_DRV_INST(inst)
Node identifier for an instance of a DT_DRV_COMPAT compatible.
Definition devicetree.h:3869
#define DT_PWMS_CELL_BY_IDX(node_id, idx, cell)
Get PWM specifier's cell value at an index.
Definition pwms.h:135

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

Parameters
instDT_DRV_COMPAT instance number
idxlogical index into pwms property
celllowercase-and-underscores cell name
Returns
the cell value at index "idx"

◆ DT_INST_PWMS_CELL_BY_NAME

#define DT_INST_PWMS_CELL_BY_NAME ( inst,
name,
cell )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PWMS_CELL_BY_NAME(DT_DRV_INST(inst), name, cell)
#define DT_PWMS_CELL_BY_NAME(node_id, name, cell)
Get a PWM specifier's cell value by name.
Definition pwms.h:182

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

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

◆ DT_INST_PWMS_CHANNEL

#define DT_INST_PWMS_CHANNEL ( inst)

#include <zephyr/devicetree/pwms.h>

Value:
#define DT_INST_PWMS_CHANNEL_BY_IDX(inst, idx)
Equivalent to DT_INST_PWMS_CELL_BY_IDX(inst, idx, channel)
Definition pwms.h:394

Equivalent to DT_INST_PWMS_CHANNEL_BY_IDX(inst, 0)

Parameters
instDT_DRV_COMPAT instance number
Returns
the channel cell value at index 0
See also
DT_INST_PWMS_CHANNEL_BY_IDX()

◆ DT_INST_PWMS_CHANNEL_BY_IDX

#define DT_INST_PWMS_CHANNEL_BY_IDX ( inst,
idx )

#include <zephyr/devicetree/pwms.h>

Value:
DT_INST_PWMS_CELL_BY_IDX(inst, idx, channel)

Equivalent to DT_INST_PWMS_CELL_BY_IDX(inst, idx, channel)

Parameters
instDT_DRV_COMPAT instance number
idxlogical index into pwms property
Returns
the channel cell value at index "idx"
See also
DT_INST_PWMS_CELL_BY_IDX()

◆ DT_INST_PWMS_CHANNEL_BY_NAME

#define DT_INST_PWMS_CHANNEL_BY_NAME ( inst,
name )

#include <zephyr/devicetree/pwms.h>

Value:
DT_INST_PWMS_CELL_BY_NAME(inst, name, channel)
#define DT_INST_PWMS_CELL_BY_NAME(inst, name, cell)
Get a DT_DRV_COMPAT instance's PWM specifier's cell value by name.
Definition pwms.h:375

Equivalent to DT_INST_PWMS_CELL_BY_NAME(inst, name, channel)

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

◆ DT_INST_PWMS_CTLR

#define DT_INST_PWMS_CTLR ( inst)

#include <zephyr/devicetree/pwms.h>

Value:
#define DT_INST_PWMS_CTLR_BY_IDX(inst, idx)
Get the node identifier for the PWM controller from a DT_DRV_COMPAT instance's pwms property at an in...
Definition pwms.h:331

Equivalent to DT_INST_PWMS_CTLR_BY_IDX(inst, 0)

Parameters
instDT_DRV_COMPAT instance number
Returns
the node identifier for the PWM controller at index 0 in the instance's "pwms" property
See also
DT_PWMS_CTLR_BY_IDX()

◆ DT_INST_PWMS_CTLR_BY_IDX

#define DT_INST_PWMS_CTLR_BY_IDX ( inst,
idx )

#include <zephyr/devicetree/pwms.h>

Value:
#define DT_PWMS_CTLR_BY_IDX(node_id, idx)
Get the node identifier for the PWM controller from a pwms property at an index.
Definition pwms.h:51

Get the node identifier for the PWM controller from a DT_DRV_COMPAT instance's pwms property at an index.

Parameters
instDT_DRV_COMPAT instance number
idxlogical index into pwms property
Returns
the node identifier for the PWM controller referenced at index "idx"
See also
DT_PWMS_CTLR_BY_IDX()

◆ DT_INST_PWMS_CTLR_BY_NAME

#define DT_INST_PWMS_CTLR_BY_NAME ( inst,
name )

#include <zephyr/devicetree/pwms.h>

Value:
#define DT_PWMS_CTLR_BY_NAME(node_id, name)
Get the node identifier for the PWM controller from a pwms property by name.
Definition pwms.h:81

Get the node identifier for the PWM controller from a DT_DRV_COMPAT instance's pwms property by name.

Parameters
instDT_DRV_COMPAT instance number
namelowercase-and-underscores name of a pwms element as defined by the node's pwm-names property
Returns
the node identifier for the PWM controller in the named element
See also
DT_PWMS_CTLR_BY_NAME()

◆ DT_INST_PWMS_FLAGS

#define DT_INST_PWMS_FLAGS ( inst)

#include <zephyr/devicetree/pwms.h>

Value:
#define DT_INST_PWMS_FLAGS_BY_IDX(inst, idx)
Equivalent to DT_INST_PWMS_CELL_BY_IDX(inst, idx, flags)
Definition pwms.h:452

Equivalent to DT_INST_PWMS_FLAGS_BY_IDX(inst, 0)

Parameters
instDT_DRV_COMPAT instance number
Returns
the flags cell value at index 0, or zero if there is none
See also
DT_INST_PWMS_FLAGS_BY_IDX()

◆ DT_INST_PWMS_FLAGS_BY_IDX

#define DT_INST_PWMS_FLAGS_BY_IDX ( inst,
idx )

#include <zephyr/devicetree/pwms.h>

Value:
flags
Definition parser.h:96

Equivalent to DT_INST_PWMS_CELL_BY_IDX(inst, idx, flags)

Parameters
instDT_DRV_COMPAT instance number
idxlogical index into pwms property
Returns
the flags cell value at index "idx", or zero if there is none
See also
DT_INST_PWMS_CELL_BY_IDX()

◆ DT_INST_PWMS_FLAGS_BY_NAME

#define DT_INST_PWMS_FLAGS_BY_NAME ( inst,
name )

#include <zephyr/devicetree/pwms.h>

Value:

Equivalent to DT_INST_PWMS_CELL_BY_NAME(inst, name, flags)

Parameters
instDT_DRV_COMPAT instance number
namelowercase-and-underscores name of a pwms element as defined by the node's pwm-names property
Returns
the flags cell value in the specifier at the named element, or zero if there is none
See also
DT_INST_PWMS_CELL_BY_NAME()

◆ DT_INST_PWMS_PERIOD

#define DT_INST_PWMS_PERIOD ( inst)

#include <zephyr/devicetree/pwms.h>

Value:
#define DT_INST_PWMS_PERIOD_BY_IDX(inst, idx)
Equivalent to DT_INST_PWMS_CELL_BY_IDX(inst, idx, period)
Definition pwms.h:423

Equivalent to DT_INST_PWMS_PERIOD_BY_IDX(inst, 0)

Parameters
instDT_DRV_COMPAT instance number
Returns
the period cell value at index 0
See also
DT_INST_PWMS_PERIOD_BY_IDX()

◆ DT_INST_PWMS_PERIOD_BY_IDX

#define DT_INST_PWMS_PERIOD_BY_IDX ( inst,
idx )

#include <zephyr/devicetree/pwms.h>

Value:
DT_INST_PWMS_CELL_BY_IDX(inst, idx, period)

Equivalent to DT_INST_PWMS_CELL_BY_IDX(inst, idx, period)

Parameters
instDT_DRV_COMPAT instance number
idxlogical index into pwms property
Returns
the period cell value at index "idx"
See also
DT_INST_PWMS_CELL_BY_IDX()

◆ DT_INST_PWMS_PERIOD_BY_NAME

#define DT_INST_PWMS_PERIOD_BY_NAME ( inst,
name )

#include <zephyr/devicetree/pwms.h>

Value:
DT_INST_PWMS_CELL_BY_NAME(inst, name, period)

Equivalent to DT_INST_PWMS_CELL_BY_NAME(inst, name, period)

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

◆ DT_PWMS_CELL

#define DT_PWMS_CELL ( node_id,
cell )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PWMS_CELL_BY_IDX(node_id, 0, cell)

Equivalent to DT_PWMS_CELL_BY_IDX(node_id, 0, cell)

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

◆ DT_PWMS_CELL_BY_IDX

#define DT_PWMS_CELL_BY_IDX ( node_id,
idx,
cell )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PHA_BY_IDX(node_id, pwms, 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:1554

Get PWM specifier's cell value at an index.

Example devicetree fragment:

pwm1: pwm-controller@... {
        compatible = "vnd,pwm";
        #pwm-cells = <2>;
};

pwm2: pwm-controller@... {
        compatible = "vnd,pwm";
        #pwm-cells = <2>;
};

n: node {
        pwms = <&pwm1 1 200000 PWM_POLARITY_NORMAL>,
               <&pwm2 3 100000 PWM_POLARITY_INVERTED>;
};

Bindings fragment for the "vnd,pwm" compatible:

pwm-cells:
  - channel
  - period
  - flags

Example usage:

DT_PWMS_CELL_BY_IDX(DT_NODELABEL(n), 0, channel) // 1
DT_PWMS_CELL_BY_IDX(DT_NODELABEL(n), 1, channel) // 3
DT_PWMS_CELL_BY_IDX(DT_NODELABEL(n), 0, period)  // 200000
DT_PWMS_CELL_BY_IDX(DT_NODELABEL(n), 1, period)  // 100000
DT_PWMS_CELL_BY_IDX(DT_NODELABEL(n), 0, flags)   // PWM_POLARITY_NORMAL
DT_PWMS_CELL_BY_IDX(DT_NODELABEL(n), 1, flags)   // PWM_POLARITY_INVERTED
Parameters
node_idnode identifier for a node with a pwms property
idxlogical index into pwms property
celllowercase-and-underscores cell name
Returns
the cell value at index "idx"
See also
DT_PHA_BY_IDX()

◆ DT_PWMS_CELL_BY_NAME

#define DT_PWMS_CELL_BY_NAME ( node_id,
name,
cell )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PHA_BY_NAME(node_id, pwms, 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:1649

Get a PWM specifier's cell value by name.

Example devicetree fragment:

pwm1: pwm-controller@... {
        compatible = "vnd,pwm";
        #pwm-cells = <2>;
};

pwm2: pwm-controller@... {
        compatible = "vnd,pwm";
        #pwm-cells = <2>;
};

n: node {
        pwms = <&pwm1 1 200000 PWM_POLARITY_NORMAL>,
               <&pwm2 3 100000 PWM_POLARITY_INVERTED>;
        pwm-names = "alpha", "beta";
};

Bindings fragment for the "vnd,pwm" compatible:

pwm-cells:
  - channel
  - period
  - flags

Example usage:

DT_PWMS_CELL_BY_NAME(DT_NODELABEL(n), alpha, channel) // 1
DT_PWMS_CELL_BY_NAME(DT_NODELABEL(n), beta, channel)  // 3
DT_PWMS_CELL_BY_NAME(DT_NODELABEL(n), alpha, period)  // 200000
DT_PWMS_CELL_BY_NAME(DT_NODELABEL(n), beta, period)   // 100000
DT_PWMS_CELL_BY_NAME(DT_NODELABEL(n), alpha, flags)   // PWM_POLARITY_NORMAL
DT_PWMS_CELL_BY_NAME(DT_NODELABEL(n), beta, flags)    // PWM_POLARITY_INVERTED
Parameters
node_idnode identifier for a node with a pwms property
namelowercase-and-underscores name of a pwms element as defined by the node's pwm-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_PWMS_CHANNEL

#define DT_PWMS_CHANNEL ( node_id)

#include <zephyr/devicetree/pwms.h>

Value:
#define DT_PWMS_CHANNEL_BY_IDX(node_id, idx)
Get a PWM specifier's channel cell value at an index.
Definition pwms.h:207

Equivalent to DT_PWMS_CHANNEL_BY_IDX(node_id, 0)

Parameters
node_idnode identifier for a node with a pwms property
Returns
the channel cell value at index 0
See also
DT_PWMS_CHANNEL_BY_IDX()

◆ DT_PWMS_CHANNEL_BY_IDX

#define DT_PWMS_CHANNEL_BY_IDX ( node_id,
idx )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PWMS_CELL_BY_IDX(node_id, idx, channel)

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

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

This is equivalent to DT_PWMS_CELL_BY_IDX(node_id, idx, channel).

Parameters
node_idnode identifier for a node with a pwms property
idxlogical index into pwms property
Returns
the channel cell value at index "idx"
See also
DT_PWMS_CELL_BY_IDX()

◆ DT_PWMS_CHANNEL_BY_NAME

#define DT_PWMS_CHANNEL_BY_NAME ( node_id,
name )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PWMS_CELL_BY_NAME(node_id, name, channel)

Get a PWM specifier's channel cell value by name.

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

This is equivalent to DT_PWMS_CELL_BY_NAME(node_id, name, channel).

Parameters
node_idnode identifier for a node with a pwms property
namelowercase-and-underscores name of a pwms element as defined by the node's pwm-names property
Returns
the channel cell value in the specifier at the named element
See also
DT_PWMS_CELL_BY_NAME()

◆ DT_PWMS_CTLR

#define DT_PWMS_CTLR ( node_id)

#include <zephyr/devicetree/pwms.h>

Value:

Equivalent to DT_PWMS_CTLR_BY_IDX(node_id, 0)

Parameters
node_idnode identifier for a node with a pwms property
Returns
the node identifier for the PWM controller at index 0 in the node's "pwms" property
See also
DT_PWMS_CTLR_BY_IDX()

◆ DT_PWMS_CTLR_BY_IDX

#define DT_PWMS_CTLR_BY_IDX ( node_id,
idx )

#include <zephyr/devicetree/pwms.h>

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

Get the node identifier for the PWM controller from a pwms property at an index.

Example devicetree fragment:

pwm1: pwm-controller@... { ... };

pwm2: pwm-controller@... { ... };

n: node {
        pwms = <&pwm1 1 PWM_POLARITY_NORMAL>,
               <&pwm2 3 PWM_POLARITY_INVERTED>;
};

Example usage:

DT_PWMS_CTLR_BY_IDX(DT_NODELABEL(n), 0) // DT_NODELABEL(pwm1)
DT_PWMS_CTLR_BY_IDX(DT_NODELABEL(n), 1) // DT_NODELABEL(pwm2)
Parameters
node_idnode identifier for a node with a pwms property
idxlogical index into pwms property
Returns
the node identifier for the PWM controller referenced at index "idx"
See also
DT_PROP_BY_PHANDLE_IDX()

◆ DT_PWMS_CTLR_BY_NAME

#define DT_PWMS_CTLR_BY_NAME ( node_id,
name )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PHANDLE_BY_NAME(node_id, pwms, 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:1723

Get the node identifier for the PWM controller from a pwms property by name.

Example devicetree fragment:

pwm1: pwm-controller@... { ... };

pwm2: pwm-controller... { ... };

n: node { pwms = <&pwm1 1 PWM_POLARITY_NORMAL>, <&pwm2 3 PWM_POLARITY_INVERTED>; pwm-names = "alpha", "beta"; };

Example usage:

DT_PWMS_CTLR_BY_NAME(DT_NODELABEL(n), alpha) // DT_NODELABEL(pwm1)
DT_PWMS_CTLR_BY_NAME(DT_NODELABEL(n), beta)  // DT_NODELABEL(pwm2)
Parameters
node_idnode identifier for a node with a pwms property
namelowercase-and-underscores name of a pwms element as defined by the node's pwm-names property
Returns
the node identifier for the PWM controller in the named element
See also
DT_PHANDLE_BY_NAME()

◆ DT_PWMS_FLAGS

#define DT_PWMS_FLAGS ( node_id)

#include <zephyr/devicetree/pwms.h>

Value:
#define DT_PWMS_FLAGS_BY_IDX(node_id, idx)
Get a PWM specifier's flags cell value at an index.
Definition pwms.h:290

Equivalent to DT_PWMS_FLAGS_BY_IDX(node_id, 0)

Parameters
node_idnode identifier for a node with a pwms property
Returns
the flags cell value at index 0, or zero if there is none
See also
DT_PWMS_FLAGS_BY_IDX()

◆ DT_PWMS_FLAGS_BY_IDX

#define DT_PWMS_FLAGS_BY_IDX ( node_id,
idx )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PHA_BY_IDX_OR(node_id, pwms, idx, flags, 0)
#define DT_PHA_BY_IDX_OR(node_id, pha, idx, cell, default_value)
Like DT_PHA_BY_IDX(), but with a fallback to default_value.
Definition devicetree.h:1580

Get a PWM specifier's flags cell value at an index.

This macro expects PWM specifiers with cells named "flags". If there is no "flags" cell in the PWM specifier, zero is returned. Refer to the node's binding to check specifier cell names if necessary.

This is equivalent to DT_PWMS_CELL_BY_IDX(node_id, idx, flags).

Parameters
node_idnode identifier for a node with a pwms property
idxlogical index into pwms property
Returns
the flags cell value at index "idx", or zero if there is none
See also
DT_PWMS_CELL_BY_IDX()

◆ DT_PWMS_FLAGS_BY_NAME

#define DT_PWMS_FLAGS_BY_NAME ( node_id,
name )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PHA_BY_NAME_OR(node_id, pwms, name, flags, 0)
#define DT_PHA_BY_NAME_OR(node_id, pha, name, cell, default_value)
Like DT_PHA_BY_NAME(), but with a fallback to default_value.
Definition devicetree.h:1673

Get a PWM specifier's flags cell value by name.

This macro expects PWM specifiers with cells named "flags". If there is no "flags" cell in the PWM specifier, zero is returned. Refer to the node's binding to check specifier cell names if necessary.

This is equivalent to DT_PWMS_CELL_BY_NAME(node_id, name, flags) if there is a flags cell, but expands to zero if there is none.

Parameters
node_idnode identifier for a node with a pwms property
namelowercase-and-underscores name of a pwms element as defined by the node's pwm-names property
Returns
the flags cell value in the specifier at the named element, or zero if there is none
See also
DT_PWMS_CELL_BY_NAME()

◆ DT_PWMS_PERIOD

#define DT_PWMS_PERIOD ( node_id)

#include <zephyr/devicetree/pwms.h>

Value:
#define DT_PWMS_PERIOD_BY_IDX(node_id, idx)
Get PWM specifier's period cell value at an index.
Definition pwms.h:248

Equivalent to DT_PWMS_PERIOD_BY_IDX(node_id, 0)

Parameters
node_idnode identifier for a node with a pwms property
Returns
the period cell value at index 0
See also
DT_PWMS_PERIOD_BY_IDX()

◆ DT_PWMS_PERIOD_BY_IDX

#define DT_PWMS_PERIOD_BY_IDX ( node_id,
idx )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PWMS_CELL_BY_IDX(node_id, idx, period)

Get PWM specifier's period cell value at an index.

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

This is equivalent to DT_PWMS_CELL_BY_IDX(node_id, idx, period).

Parameters
node_idnode identifier for a node with a pwms property
idxlogical index into pwms property
Returns
the period cell value at index "idx"
See also
DT_PWMS_CELL_BY_IDX()

◆ DT_PWMS_PERIOD_BY_NAME

#define DT_PWMS_PERIOD_BY_NAME ( node_id,
name )

#include <zephyr/devicetree/pwms.h>

Value:
DT_PWMS_CELL_BY_NAME(node_id, name, period)

Get a PWM specifier's period cell value by name.

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

This is equivalent to DT_PWMS_CELL_BY_NAME(node_id, name, period).

Parameters
node_idnode identifier for a node with a pwms property
namelowercase-and-underscores name of a pwms element as defined by the node's pwm-names property
Returns
the period cell value in the specifier at the named element
See also
DT_PWMS_CELL_BY_NAME()