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

Macros

#define DT_MBOX_CTLR_BY_NAME(node_id, name)    DT_PHANDLE_BY_NAME(node_id, mboxes, name)
 Get the node identifier for the MBOX controller from a mboxes property by name.
 
#define DT_MBOX_CHANNEL_BY_NAME(node_id, name)    DT_PHA_BY_NAME_OR(node_id, mboxes, name, channel, 0)
 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 
)     DT_PHA_BY_NAME_OR(node_id, mboxes, name, channel, 0)

#include <zephyr/devicetree/mbox.h>

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

#include <zephyr/devicetree/mbox.h>

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