Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
Macros | |
#define | DT_BUS(node_id) |
Node's bus controller. | |
#define | DT_ON_BUS(node_id, bus) |
Is a node on a bus of a given type? | |
#define DT_BUS | ( | node_id | ) |
#include <zephyr/devicetree.h>
Node's bus controller.
Get the node identifier of the node's bus controller. This can be used with DT_PROP() to get properties of the bus controller.
It is an error to use this with nodes which do not have bus controllers.
Example devicetree fragment:
Example usage:
node_id | node identifier |
#define DT_ON_BUS | ( | node_id, | |
bus ) |
#include <zephyr/devicetree.h>
Is a node on a bus of a given type?
Example devicetree overlay:
Example usage, assuming i2c0
is an I2C bus controller node, and therefore temp
is on an I2C bus:
node_id | node identifier |
bus | lowercase-and-underscores bus type as a C token (i.e. without quotes) |