Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Devicetree MBOX API

Macros

#define DT_MBOX_CTLR_BY_NAME(node_id, name)
 Get the node identifier for the MBOX controller from a mboxes property by name.
 
#define DT_MBOX_CHANNEL_BY_NAME(node_id, name)
 Get a MBOX channel value by name.
 

Detailed Description

Macro Definition Documentation

◆ DT_MBOX_CHANNEL_BY_NAME

#define DT_MBOX_CHANNEL_BY_NAME ( node_id,
name )

#include <zephyr/devicetree/mbox.h>

Value:
DT_PHA_BY_NAME_OR(node_id, mboxes, name, channel, 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:1655

Get a MBOX channel value by name.

Example devicetree fragment:

mbox1: mbox@... {
        #mbox-cells = <1>;
};

n: node {
    mboxes = <&mbox1 1>,
             <&mbox1 6>;
    mbox-names = "tx", "rx";
};

Bindings fragment for the mbox compatible:

mbox-cells:
  - channel

Example usage:

DT_MBOX_CHANNEL_BY_NAME(DT_NODELABEL(n), tx) // 1
DT_MBOX_CHANNEL_BY_NAME(DT_NODELABEL(n), rx) // 6
Parameters
node_idnode identifier for a node with a mboxes property
namelowercase-and-underscores name of a mboxes element as defined by the node's mbox-names property
Returns
the channel value in the specifier at the named element or 0 if no channels are supported
See also
DT_PHA_BY_NAME_OR()

◆ DT_MBOX_CTLR_BY_NAME

#define DT_MBOX_CTLR_BY_NAME ( node_id,
name )

#include <zephyr/devicetree/mbox.h>

Value:
DT_PHANDLE_BY_NAME(node_id, mboxes, 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 MBOX controller from a mboxes property by name.

Example devicetree fragment:

mbox1: mbox-controller@... { ... };

n: node {
        mboxes = <&mbox1 8>,
                 <&mbox1 9>;
        mbox-names = "tx", "rx";
};

Example usage:

DT_MBOX_CTLR_BY_NAME(DT_NODELABEL(n), tx) // DT_NODELABEL(mbox1)
DT_MBOX_CTLR_BY_NAME(DT_NODELABEL(n), rx) // DT_NODELABEL(mbox1)
Parameters
node_idnode identifier for a node with a mboxes property
namelowercase-and-underscores name of a mboxes element as defined by the node's mbox-names property
Returns
the node identifier for the MBOX controller in the named element
See also
DT_PHANDLE_BY_NAME()