Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Devicetree DMA API

Macros

#define DT_DMAS_CTLR_BY_IDX(node_id, idx)
 Get the node identifier for the DMA controller from a dmas property at an index.
 
#define DT_DMAS_CTLR_BY_NAME(node_id, name)
 Get the node identifier for the DMA controller from a dmas property by name.
 
#define DT_DMAS_CTLR(node_id)
 Equivalent to DT_DMAS_CTLR_BY_IDX(node_id, 0)
 
#define DT_INST_DMAS_CTLR_BY_IDX(inst, idx)
 Get the node identifier for the DMA controller from a DT_DRV_COMPAT instance's dmas property at an index.
 
#define DT_INST_DMAS_CTLR_BY_NAME(inst, name)
 Get the node identifier for the DMA controller from a DT_DRV_COMPAT instance's dmas property by name.
 
#define DT_INST_DMAS_CTLR(inst)
 Equivalent to DT_INST_DMAS_CTLR_BY_IDX(inst, 0)
 
#define DT_DMAS_CELL_BY_IDX(node_id, idx, cell)
 Get a DMA specifier's cell value at an index.
 
#define DT_INST_DMAS_CELL_BY_IDX(inst, idx, cell)
 Get a DT_DRV_COMPAT instance's DMA specifier's cell value at an index.
 
#define DT_DMAS_CELL_BY_NAME(node_id, name, cell)
 Get a DMA specifier's cell value by name.
 
#define DT_INST_DMAS_CELL_BY_NAME(inst, name, cell)
 Get a DT_DRV_COMPAT instance's DMA specifier's cell value by name.
 
#define DT_DMAS_HAS_IDX(node_id, idx)
 Is index "idx" valid for a dmas property?
 
#define DT_INST_DMAS_HAS_IDX(inst, idx)
 Is index "idx" valid for a DT_DRV_COMPAT instance's dmas property?
 
#define DT_DMAS_HAS_NAME(node_id, name)
 Does a dmas property have a named element?
 
#define DT_INST_DMAS_HAS_NAME(inst, name)
 Does a DT_DRV_COMPAT instance's dmas property have a named element?
 

Detailed Description

Macro Definition Documentation

◆ DT_DMAS_CELL_BY_IDX

#define DT_DMAS_CELL_BY_IDX ( node_id,
idx,
cell )

#include <zephyr/devicetree/dma.h>

Value:
DT_PHA_BY_IDX(node_id, dmas, 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:1536

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

Example devicetree fragment:

dma1: dma@... {
        compatible = "vnd,dma";
        #dma-cells = <2>;
};

dma2: dma@... {
        compatible = "vnd,dma";
        #dma-cells = <2>;
};

n: node {
    dmas = <&dma1 1 0x400>,
           <&dma2 6 0x404>;
};

Bindings fragment for the vnd,dma compatible:

dma-cells:
  - channel
  - config

Example usage:

DT_DMAS_CELL_BY_IDX(DT_NODELABEL(n), 0, channel) // 1
DT_DMAS_CELL_BY_IDX(DT_NODELABEL(n), 1, channel) // 6
DT_DMAS_CELL_BY_IDX(DT_NODELABEL(n), 0, config) // 0x400
DT_DMAS_CELL_BY_IDX(DT_NODELABEL(n), 1, config) // 0x404
Parameters
node_idnode identifier for a node with a dmas property
idxlogical index into dmas property
celllowercase-and-underscores cell name
Returns
the cell value at index "idx"
See also
DT_PHA_BY_IDX()

◆ DT_DMAS_CELL_BY_NAME

#define DT_DMAS_CELL_BY_NAME ( node_id,
name,
cell )

#include <zephyr/devicetree/dma.h>

Value:
DT_PHA_BY_NAME(node_id, dmas, 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:1631

Get a DMA specifier's cell value by name.

Example devicetree fragment:

dma1: dma@... {
        compatible = "vnd,dma";
        #dma-cells = <2>;
};

dma2: dma@... {
        compatible = "vnd,dma";
        #dma-cells = <2>;
};

n: node {
    dmas = <&dma1 1 0x400>,
           <&dma2 6 0x404>;
    dma-names = "tx", "rx";
};

Bindings fragment for the vnd,dma compatible:

dma-cells:
  - channel
  - config

Example usage:

DT_DMAS_CELL_BY_NAME(DT_NODELABEL(n), tx, channel) // 1
DT_DMAS_CELL_BY_NAME(DT_NODELABEL(n), rx, channel) // 6
DT_DMAS_CELL_BY_NAME(DT_NODELABEL(n), tx, config) // 0x400
DT_DMAS_CELL_BY_NAME(DT_NODELABEL(n), rx, config) // 0x404
Parameters
node_idnode identifier for a node with a dmas property
namelowercase-and-underscores name of a dmas element as defined by the node's dma-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_DMAS_CTLR

#define DT_DMAS_CTLR ( node_id)

#include <zephyr/devicetree/dma.h>

Value:
#define DT_DMAS_CTLR_BY_IDX(node_id, idx)
Get the node identifier for the DMA controller from a dmas property at an index.
Definition dma.h:51

Equivalent to DT_DMAS_CTLR_BY_IDX(node_id, 0)

Parameters
node_idnode identifier for a node with a dmas property
Returns
the node identifier for the DMA controller at index 0 in the node's "dmas" property
See also
DT_DMAS_CTLR_BY_IDX()

◆ DT_DMAS_CTLR_BY_IDX

#define DT_DMAS_CTLR_BY_IDX ( node_id,
idx )

#include <zephyr/devicetree/dma.h>

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

Get the node identifier for the DMA controller from a dmas property at an index.

Example devicetree fragment:

dma1: dma@... { ... };

dma2: dma@... { ... };

n: node {
    dmas = <&dma1 1 2 0x400 0x3>,
            <&dma2 6 3 0x404 0x5>;
};

Example usage:

DT_DMAS_CTLR_BY_IDX(DT_NODELABEL(n), 0) // DT_NODELABEL(dma1)
DT_DMAS_CTLR_BY_IDX(DT_NODELABEL(n), 1) // DT_NODELABEL(dma2)
Parameters
node_idnode identifier for a node with a dmas property
idxlogical index into dmas property
Returns
the node identifier for the DMA controller referenced at index "idx"
See also
DT_PROP_BY_PHANDLE_IDX()

◆ DT_DMAS_CTLR_BY_NAME

#define DT_DMAS_CTLR_BY_NAME ( node_id,
name )

#include <zephyr/devicetree/dma.h>

Value:
DT_PHANDLE_BY_NAME(node_id, dmas, 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:1705

Get the node identifier for the DMA controller from a dmas property by name.

Example devicetree fragment:

dma1: dma@... { ... };

dma2: dma@... { ... };

n: node {
    dmas = <&dma1 1 2 0x400 0x3>,
            <&dma2 6 3 0x404 0x5>;
    dma-names = "tx", "rx";
};

Example usage:

DT_DMAS_CTLR_BY_NAME(DT_NODELABEL(n), tx) // DT_NODELABEL(dma1)
DT_DMAS_CTLR_BY_NAME(DT_NODELABEL(n), rx) // DT_NODELABEL(dma2)
Parameters
node_idnode identifier for a node with a dmas property
namelowercase-and-underscores name of a dmas element as defined by the node's dma-names property
Returns
the node identifier for the DMA controller in the named element
See also
DT_PHANDLE_BY_NAME()

◆ DT_DMAS_HAS_IDX

#define DT_DMAS_HAS_IDX ( node_id,
idx )

#include <zephyr/devicetree/dma.h>

Value:
IS_ENABLED(DT_CAT4(node_id, _P_dmas_IDX_, idx, _EXISTS))
#define IS_ENABLED(config_macro)
Check for macro definition in compiler-visible expressions.
Definition util_macro.h:140

Is index "idx" valid for a dmas property?

Parameters
node_idnode identifier for a node with a dmas property
idxlogical index into dmas property
Returns
1 if the "dmas" property has index "idx", 0 otherwise

◆ DT_DMAS_HAS_NAME

#define DT_DMAS_HAS_NAME ( node_id,
name )

#include <zephyr/devicetree/dma.h>

Value:
DT_PROP_HAS_NAME(node_id, dmas, name)
#define DT_PROP_HAS_NAME(node_id, prop, name)
Is name name available in a foo-names property?
Definition devicetree.h:854

Does a dmas property have a named element?

Parameters
node_idnode identifier for a node with a dmas property
namelowercase-and-underscores name of a dmas element as defined by the node's dma-names property
Returns
1 if the dmas property has the named element, 0 otherwise

◆ DT_INST_DMAS_CELL_BY_IDX

#define DT_INST_DMAS_CELL_BY_IDX ( inst,
idx,
cell )

#include <zephyr/devicetree/dma.h>

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

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

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

◆ DT_INST_DMAS_CELL_BY_NAME

#define DT_INST_DMAS_CELL_BY_NAME ( inst,
name,
cell )

#include <zephyr/devicetree/dma.h>

Value:
DT_DMAS_CELL_BY_NAME(DT_DRV_INST(inst), name, cell)
#define DT_DMAS_CELL_BY_NAME(node_id, name, cell)
Get a DMA specifier's cell value by name.
Definition dma.h:220

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

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

◆ DT_INST_DMAS_CTLR

#define DT_INST_DMAS_CTLR ( inst)

#include <zephyr/devicetree/dma.h>

Value:
#define DT_INST_DMAS_CTLR_BY_IDX(inst, idx)
Get the node identifier for the DMA controller from a DT_DRV_COMPAT instance's dmas property at an in...
Definition dma.h:102

Equivalent to DT_INST_DMAS_CTLR_BY_IDX(inst, 0)

Parameters
instDT_DRV_COMPAT instance number
Returns
the node identifier for the DMA controller at index 0 in the instance's "dmas" property
See also
DT_DMAS_CTLR_BY_IDX()

◆ DT_INST_DMAS_CTLR_BY_IDX

#define DT_INST_DMAS_CTLR_BY_IDX ( inst,
idx )

#include <zephyr/devicetree/dma.h>

Value:

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

Parameters
instDT_DRV_COMPAT instance number
idxlogical index into dmas property
Returns
the node identifier for the DMA controller referenced at index "idx"
See also
DT_DMAS_CTLR_BY_IDX()

◆ DT_INST_DMAS_CTLR_BY_NAME

#define DT_INST_DMAS_CTLR_BY_NAME ( inst,
name )

#include <zephyr/devicetree/dma.h>

Value:
#define DT_DMAS_CTLR_BY_NAME(node_id, name)
Get the node identifier for the DMA controller from a dmas property by name.
Definition dma.h:80

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

Parameters
instDT_DRV_COMPAT instance number
namelowercase-and-underscores name of a dmas element as defined by the node's dma-names property
Returns
the node identifier for the DMA controller in the named element
See also
DT_DMAS_CTLR_BY_NAME()

◆ DT_INST_DMAS_HAS_IDX

#define DT_INST_DMAS_HAS_IDX ( inst,
idx )

#include <zephyr/devicetree/dma.h>

Value:
#define DT_DMAS_HAS_IDX(node_id, idx)
Is index "idx" valid for a dmas property?
Definition dma.h:241

Is index "idx" valid for a DT_DRV_COMPAT instance's dmas property?

Parameters
instDT_DRV_COMPAT instance number
idxlogical index into dmas property
Returns
1 if the "dmas" property has a specifier at index "idx", 0 otherwise

◆ DT_INST_DMAS_HAS_NAME

#define DT_INST_DMAS_HAS_NAME ( inst,
name )

#include <zephyr/devicetree/dma.h>

Value:
#define DT_DMAS_HAS_NAME(node_id, name)
Does a dmas property have a named element?
Definition dma.h:260

Does a DT_DRV_COMPAT instance's dmas property have a named element?

Parameters
instDT_DRV_COMPAT instance number
namelowercase-and-underscores name of a dmas element as defined by the node's dma-names property
Returns
1 if the dmas property has the named element, 0 otherwise