Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
Macros | |
#define | DT_BUS(node_id) DT_CAT(node_id, _BUS) |
Node's bus controller. | |
#define | DT_ON_BUS(node_id, bus) IS_ENABLED(DT_CAT3(node_id, _BUS_, bus)) |
Is a node on a bus of a given type? | |
#define DT_BUS | ( | node_id | ) | DT_CAT(node_id, _BUS) |
#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 | |||
) | IS_ENABLED(DT_CAT3(node_id, _BUS_, 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) |