|
Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Macros | |
| #define | DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT) |
| Node identifier for an instance of a DT_DRV_COMPAT compatible. More... | |
| #define | DT_INST_FOREACH_CHILD(inst, fn) DT_FOREACH_CHILD(DT_DRV_INST(inst), fn) |
| Call "fn" on all child nodes of DT_DRV_INST(inst). More... | |
| #define | DT_INST_FOREACH_CHILD_VARGS(inst, fn, ...) DT_FOREACH_CHILD_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__) |
| Call "fn" on all child nodes of DT_DRV_INST(inst). More... | |
| #define | DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop) |
| Get a DT_DRV_COMPAT instance property. More... | |
| #define | DT_INST_PROP_LEN(inst, prop) DT_PROP_LEN(DT_DRV_INST(inst), prop) |
| Get a DT_DRV_COMPAT property length. More... | |
| #define | DT_INST_PROP_HAS_IDX(inst, prop, idx) DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx) |
| Is index "idx" valid for an array type property on a DT_DRV_COMPAT instance? More... | |
| #define | DT_INST_PROP_BY_IDX(inst, prop, idx) DT_PROP_BY_IDX(DT_DRV_INST(inst), prop, idx) |
| Get a DT_DRV_COMPAT element value in an array property. More... | |
| #define | DT_INST_PROP_OR(inst, prop, default_value) DT_PROP_OR(DT_DRV_INST(inst), prop, default_value) |
| Like DT_INST_PROP(), but with a fallback to default_value. More... | |
| #define | DT_INST_LABEL(inst) DT_INST_PROP(inst, label) |
| Get a DT_DRV_COMPAT instance's "label" property. More... | |
| #define | DT_INST_PROP_BY_PHANDLE(inst, ph, prop) DT_INST_PROP_BY_PHANDLE_IDX(inst, ph, 0, prop) |
| Get a DT_DRV_COMPAT instance's property value from a phandle's node. More... | |
| #define | DT_INST_PROP_BY_PHANDLE_IDX(inst, phs, idx, prop) DT_PROP_BY_PHANDLE_IDX(DT_DRV_INST(inst), phs, idx, prop) |
| Get a DT_DRV_COMPAT instance's property value from a phandle in a property. More... | |
| #define | DT_INST_PHA_BY_IDX(inst, pha, idx, cell) DT_PHA_BY_IDX(DT_DRV_INST(inst), pha, idx, cell) |
| Get a DT_DRV_COMPAT instance's phandle-array specifier value at an index. More... | |
| #define | DT_INST_PHA_BY_IDX_OR(inst, pha, idx, cell, default_value) DT_PHA_BY_IDX_OR(DT_DRV_INST(inst), pha, idx, cell, default_value) |
| Like DT_INST_PHA_BY_IDX(), but with a fallback to default_value. More... | |
| #define | DT_INST_PHA(inst, pha, cell) DT_INST_PHA_BY_IDX(inst, pha, 0, cell) |
| Get a DT_DRV_COMPAT instance's phandle-array specifier value Equivalent to DT_INST_PHA_BY_IDX(inst, pha, 0, cell) More... | |
| #define | DT_INST_PHA_OR(inst, pha, cell, default_value) DT_INST_PHA_BY_IDX_OR(inst, pha, 0, cell, default_value) |
| Like DT_INST_PHA(), but with a fallback to default_value. More... | |
| #define | DT_INST_PHA_BY_NAME(inst, pha, name, cell) DT_PHA_BY_NAME(DT_DRV_INST(inst), pha, name, cell) |
| Get a DT_DRV_COMPAT instance's value within a phandle-array specifier by name. More... | |
| #define | DT_INST_PHA_BY_NAME_OR(inst, pha, name, cell, default_value) DT_PHA_BY_NAME_OR(DT_DRV_INST(inst), pha, name, cell, default_value) |
| Like DT_INST_PHA_BY_NAME(), but with a fallback to default_value. More... | |
| #define | DT_INST_PHANDLE_BY_NAME(inst, pha, name) DT_PHANDLE_BY_NAME(DT_DRV_INST(inst), pha, name) \ |
| Get a DT_DRV_COMPAT instance's phandle node identifier from a phandle array by name. More... | |
| #define | DT_INST_PHANDLE_BY_IDX(inst, prop, idx) DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), prop, idx) |
| Get a DT_DRV_COMPAT instance's node identifier for a phandle in a property. More... | |
| #define | DT_INST_PHANDLE(inst, prop) DT_INST_PHANDLE_BY_IDX(inst, prop, 0) |
| Get a DT_DRV_COMPAT instance's node identifier for a phandle property's value. More... | |
| #define | DT_INST_REG_HAS_IDX(inst, idx) DT_REG_HAS_IDX(DT_DRV_INST(inst), idx) |
| is "idx" a valid register block index on a DT_DRV_COMPAT instance? More... | |
| #define | DT_INST_REG_ADDR_BY_IDX(inst, idx) DT_REG_ADDR_BY_IDX(DT_DRV_INST(inst), idx) |
| Get a DT_DRV_COMPAT instance's idx-th register block's address. More... | |
| #define | DT_INST_REG_SIZE_BY_IDX(inst, idx) DT_REG_SIZE_BY_IDX(DT_DRV_INST(inst), idx) |
| Get a DT_DRV_COMPAT instance's idx-th register block's size. More... | |
| #define | DT_INST_REG_ADDR_BY_NAME(inst, name) DT_REG_ADDR_BY_NAME(DT_DRV_INST(inst), name) |
| Get a DT_DRV_COMPAT's register block address by name. More... | |
| #define | DT_INST_REG_SIZE_BY_NAME(inst, name) DT_REG_SIZE_BY_NAME(DT_DRV_INST(inst), name) |
| Get a DT_DRV_COMPAT's register block size by name. More... | |
| #define | DT_INST_REG_ADDR(inst) DT_INST_REG_ADDR_BY_IDX(inst, 0) |
| Get a DT_DRV_COMPAT's (only) register block address. More... | |
| #define | DT_INST_REG_SIZE(inst) DT_INST_REG_SIZE_BY_IDX(inst, 0) |
| Get a DT_DRV_COMPAT's (only) register block size. More... | |
| #define | DT_INST_IRQ_BY_IDX(inst, idx, cell) DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell) |
| Get a DT_DRV_COMPAT interrupt specifier value at an index. More... | |
| #define | DT_INST_IRQ_BY_NAME(inst, name, cell) DT_IRQ_BY_NAME(DT_DRV_INST(inst), name, cell) |
| Get a DT_DRV_COMPAT interrupt specifier value by name. More... | |
| #define | DT_INST_IRQ(inst, cell) DT_INST_IRQ_BY_IDX(inst, 0, cell) |
| Get a DT_DRV_COMPAT interrupt specifier's value. More... | |
| #define | DT_INST_IRQN(inst) DT_INST_IRQ(inst, irq) |
| Get a DT_DRV_COMPAT's (only) irq number. More... | |
| #define | DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst)) |
| Get a DT_DRV_COMPAT's bus node identifier. More... | |
| #define | DT_INST_BUS_LABEL(inst) DT_BUS_LABEL(DT_DRV_INST(inst)) |
| Get a DT_DRV_COMPAT's bus node's label property. More... | |
| #define | DT_INST_ON_BUS(inst, bus) DT_ON_BUS(DT_DRV_INST(inst), bus) |
| Test if a DT_DRV_COMPAT's bus type is a given type. More... | |
| #define | DT_ANY_INST_ON_BUS_STATUS_OKAY(bus) DT_COMPAT_ON_BUS_INTERNAL(DT_DRV_COMPAT, bus) |
| Test if any DT_DRV_COMPAT node is on a bus of a given type and has status okay. More... | |
| #define | DT_INST_FOREACH_STATUS_OKAY(fn) |
| Call "fn" on all nodes with compatible DT_DRV_COMPAT and status "okay". More... | |
| #define | DT_INST_FOREACH_STATUS_OKAY_VARGS(fn, ...) |
| Call "fn" on all nodes with compatible DT_DRV_COMPAT and status "okay" with multiple arguments. More... | |
| #define | DT_INST_FOREACH_PROP_ELEM(inst, prop, fn) DT_FOREACH_PROP_ELEM(DT_DRV_INST(inst), prop, fn) |
| Invokes "fn" for each element of property "prop" for a DT_DRV_COMPAT instance. More... | |
| #define | DT_INST_FOREACH_PROP_ELEM_VARGS(inst, prop, fn, ...) DT_FOREACH_PROP_ELEM_VARGS(DT_DRV_INST(inst), prop, fn, __VA_ARGS__) |
| Invokes "fn" for each element of property "prop" for a DT_DRV_COMPAT instance with multiple arguments. More... | |
| #define | DT_INST_NODE_HAS_PROP(inst, prop) DT_NODE_HAS_PROP(DT_DRV_INST(inst), prop) |
| Does a DT_DRV_COMPAT instance have a property? More... | |
| #define | DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, idx, cell) DT_PHA_HAS_CELL_AT_IDX(DT_DRV_INST(inst), pha, idx, cell) |
| Does a phandle array have a named cell specifier at an index for a DT_DRV_COMPAT instance? More... | |
| #define | DT_INST_PHA_HAS_CELL(inst, pha, cell) DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, 0, cell) |
| Does a phandle array have a named cell specifier at index 0 for a DT_DRV_COMPAT instance? More... | |
| #define | DT_INST_IRQ_HAS_IDX(inst, idx) DT_IRQ_HAS_IDX(DT_DRV_INST(inst), idx) |
| is index valid for interrupt property on a DT_DRV_COMPAT instance? More... | |
| #define | DT_INST_IRQ_HAS_CELL_AT_IDX(inst, idx, cell) DT_IRQ_HAS_CELL_AT_IDX(DT_DRV_INST(inst), idx, cell) |
| Does a DT_DRV_COMPAT instance have an interrupt named cell specifier? More... | |
| #define | DT_INST_IRQ_HAS_CELL(inst, cell) DT_INST_IRQ_HAS_CELL_AT_IDX(inst, 0, cell) |
| Does a DT_DRV_COMPAT instance have an interrupt value? More... | |
| #define | DT_INST_IRQ_HAS_NAME(inst, name) DT_IRQ_HAS_NAME(DT_DRV_INST(inst), name) |
| Does a DT_DRV_COMPAT instance have an interrupt value? More... | |
| #define DT_ANY_INST_ON_BUS_STATUS_OKAY | ( | bus | ) | DT_COMPAT_ON_BUS_INTERNAL(DT_DRV_COMPAT, bus) |
#include <include/devicetree.h>
Test if any DT_DRV_COMPAT node is on a bus of a given type and has status okay.
This is a special-purpose macro which can be useful when writing drivers for devices which can appear on multiple buses. One example is a sensor device which may be wired on an I2C or SPI bus.
Example devicetree overlay:
&i2c0 {
temp: temperature-sensor@76 {
compatible = "vnd,some-sensor";
reg = <0x76>;
};
};
Example usage, assuming "i2c0" is an I2C bus controller node, and therefore "temp" is on an I2C bus:
#define DT_DRV_COMPAT vnd_some_sensor DT_ANY_INST_ON_BUS_STATUS_OKAY(i2c) // 1
| bus | a binding's bus type as a C token, lowercased and without quotes |
| #define DT_DRV_INST | ( | inst | ) | DT_INST(inst, DT_DRV_COMPAT) |
#include <include/devicetree.h>
Node identifier for an instance of a DT_DRV_COMPAT compatible.
| inst | instance number |
| #define DT_INST_BUS | ( | inst | ) | DT_BUS(DT_DRV_INST(inst)) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT's bus node identifier.
| inst | instance number |
| #define DT_INST_BUS_LABEL | ( | inst | ) | DT_BUS_LABEL(DT_DRV_INST(inst)) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT's bus node's label property.
| inst | instance number |
| #define DT_INST_FOREACH_CHILD | ( | inst, | |
| fn | |||
| ) | DT_FOREACH_CHILD(DT_DRV_INST(inst), fn) |
#include <include/devicetree.h>
Call "fn" on all child nodes of DT_DRV_INST(inst).
The macro "fn" should take one argument, which is the node identifier for the child node.
| inst | instance number |
| fn | macro to invoke on each child node identifier |
| #define DT_INST_FOREACH_CHILD_VARGS | ( | inst, | |
| fn, | |||
| ... | |||
| ) | DT_FOREACH_CHILD_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__) |
#include <include/devicetree.h>
Call "fn" on all child nodes of DT_DRV_INST(inst).
The macro "fn" takes multiple arguments. The first should be the node identifier for the child node. The remaining are passed-in by the caller.
| inst | instance number |
| fn | macro to invoke on each child node identifier |
| ... | variable number of arguments to pass to fn |
| #define DT_INST_FOREACH_PROP_ELEM | ( | inst, | |
| prop, | |||
| fn | |||
| ) | DT_FOREACH_PROP_ELEM(DT_DRV_INST(inst), prop, fn) |
#include <include/devicetree.h>
Invokes "fn" for each element of property "prop" for a DT_DRV_COMPAT instance.
Equivalent to DT_FOREACH_PROP_ELEM(DT_DRV_INST(inst), prop, fn).
| inst | instance number |
| prop | lowercase-and-underscores property name |
| fn | macro to invoke |
| #define DT_INST_FOREACH_PROP_ELEM_VARGS | ( | inst, | |
| prop, | |||
| fn, | |||
| ... | |||
| ) | DT_FOREACH_PROP_ELEM_VARGS(DT_DRV_INST(inst), prop, fn, __VA_ARGS__) |
#include <include/devicetree.h>
Invokes "fn" for each element of property "prop" for a DT_DRV_COMPAT instance with multiple arguments.
Equivalent to DT_FOREACH_PROP_ELEM_VARGS(DT_DRV_INST(inst), prop, fn, VA_ARGS)
| inst | instance number |
| prop | lowercase-and-underscores property name |
| fn | macro to invoke |
| ... | variable number of arguments to pass to fn |
| #define DT_INST_FOREACH_STATUS_OKAY | ( | fn | ) |
#include <include/devicetree.h>
Call "fn" on all nodes with compatible DT_DRV_COMPAT and status "okay".
This macro calls "fn(inst)" on each "inst" number that refers to a node with status "okay". Whitespace is added between invocations.
Example devicetree fragment:
a {
compatible = "vnd,device";
status = "okay";
label = "DEV_A";
};
b {
compatible = "vnd,device";
status = "okay";
label = "DEV_B";
};
c {
compatible = "vnd,device";
status = "disabled";
label = "DEV_C";
};
Example usage:
#define DT_DRV_COMPAT vnd_device #define MY_FN(inst) DT_INST_LABEL(inst), DT_INST_FOREACH_STATUS_OKAY(MY_FN)
This expands to:
MY_FN(0) MY_FN(1)
and from there, to either this:
"DEV_A", "DEV_B",
or this:
"DEV_B", "DEV_A",
No guarantees are made about the order that a and b appear in the expansion.
Note that "fn" is responsible for adding commas, semicolons, or other separators or terminators.
Device drivers should use this macro whenever possible to instantiate a struct device for each enabled node in the devicetree of the driver's compatible DT_DRV_COMPAT.
| fn | Macro to call for each enabled node. Must accept an instance number as its only parameter. |
| #define DT_INST_FOREACH_STATUS_OKAY_VARGS | ( | fn, | |
| ... | |||
| ) |
#include <include/devicetree.h>
Call "fn" on all nodes with compatible DT_DRV_COMPAT and status "okay" with multiple arguments.
| fn | Macro to call for each enabled node. Must accept an instance number as its only parameter. |
| ... | variable number of arguments to pass to fn |
| #define DT_INST_IRQ | ( | inst, | |
| cell | |||
| ) | DT_INST_IRQ_BY_IDX(inst, 0, cell) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT interrupt specifier's value.
| inst | instance number |
| cell | cell name specifier |
| #define DT_INST_IRQ_BY_IDX | ( | inst, | |
| idx, | |||
| cell | |||
| ) | DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT interrupt specifier value at an index.
| inst | instance number |
| idx | logical index into the interrupt specifier array |
| cell | cell name specifier |
| #define DT_INST_IRQ_BY_NAME | ( | inst, | |
| name, | |||
| cell | |||
| ) | DT_IRQ_BY_NAME(DT_DRV_INST(inst), name, cell) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT interrupt specifier value by name.
| inst | instance number |
| name | lowercase-and-underscores interrupt specifier name |
| cell | cell name specifier |
| #define DT_INST_IRQ_HAS_CELL | ( | inst, | |
| cell | |||
| ) | DT_INST_IRQ_HAS_CELL_AT_IDX(inst, 0, cell) |
#include <include/devicetree.h>
Does a DT_DRV_COMPAT instance have an interrupt value?
| inst | instance number |
| cell | named cell value whose existence to check |
| #define DT_INST_IRQ_HAS_CELL_AT_IDX | ( | inst, | |
| idx, | |||
| cell | |||
| ) | DT_IRQ_HAS_CELL_AT_IDX(DT_DRV_INST(inst), idx, cell) |
#include <include/devicetree.h>
Does a DT_DRV_COMPAT instance have an interrupt named cell specifier?
| inst | instance number |
| idx | index to check |
| cell | named cell value whose existence to check |
| #define DT_INST_IRQ_HAS_IDX | ( | inst, | |
| idx | |||
| ) | DT_IRQ_HAS_IDX(DT_DRV_INST(inst), idx) |
#include <include/devicetree.h>
is index valid for interrupt property on a DT_DRV_COMPAT instance?
| inst | instance number |
| idx | logical index into the interrupt specifier array |
| #define DT_INST_IRQ_HAS_NAME | ( | inst, | |
| name | |||
| ) | DT_IRQ_HAS_NAME(DT_DRV_INST(inst), name) |
#include <include/devicetree.h>
Does a DT_DRV_COMPAT instance have an interrupt value?
| inst | instance number |
| name | lowercase-and-underscores interrupt specifier name |
| #define DT_INST_IRQN | ( | inst | ) | DT_INST_IRQ(inst, irq) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT's (only) irq number.
| inst | instance number |
| #define DT_INST_LABEL | ( | inst | ) | DT_INST_PROP(inst, label) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance's "label" property.
| inst | instance number |
| #define DT_INST_NODE_HAS_PROP | ( | inst, | |
| prop | |||
| ) | DT_NODE_HAS_PROP(DT_DRV_INST(inst), prop) |
#include <include/devicetree.h>
Does a DT_DRV_COMPAT instance have a property?
| inst | instance number |
| prop | lowercase-and-underscores property name |
| #define DT_INST_ON_BUS | ( | inst, | |
| bus | |||
| ) | DT_ON_BUS(DT_DRV_INST(inst), bus) |
#include <include/devicetree.h>
Test if a DT_DRV_COMPAT's bus type is a given type.
| inst | instance number |
| bus | a binding's bus type as a C token, lowercased and without quotes |
| #define DT_INST_PHA | ( | inst, | |
| pha, | |||
| cell | |||
| ) | DT_INST_PHA_BY_IDX(inst, pha, 0, cell) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance's phandle-array specifier value Equivalent to DT_INST_PHA_BY_IDX(inst, pha, 0, cell)
| inst | instance number |
| pha | lowercase-and-underscores property with type "phandle-array" |
| cell | binding's cell name for the specifier at "pha" index 0 |
| #define DT_INST_PHA_BY_IDX | ( | inst, | |
| pha, | |||
| idx, | |||
| cell | |||
| ) | DT_PHA_BY_IDX(DT_DRV_INST(inst), pha, idx, cell) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance's phandle-array specifier value at an index.
| inst | instance number |
| pha | lowercase-and-underscores property with type "phandle-array" |
| idx | logical index into the property "pha" |
| cell | binding's cell name within the specifier at index "idx" |
| #define DT_INST_PHA_BY_IDX_OR | ( | inst, | |
| pha, | |||
| idx, | |||
| cell, | |||
| default_value | |||
| ) | DT_PHA_BY_IDX_OR(DT_DRV_INST(inst), pha, idx, cell, default_value) |
#include <include/devicetree.h>
Like DT_INST_PHA_BY_IDX(), but with a fallback to default_value.
| inst | instance number |
| pha | lowercase-and-underscores property with type "phandle-array" |
| idx | logical index into the property "pha" |
| cell | binding's cell name within the specifier at index "idx" |
| default_value | a fallback value to expand to |
| #define DT_INST_PHA_BY_NAME | ( | inst, | |
| pha, | |||
| name, | |||
| cell | |||
| ) | DT_PHA_BY_NAME(DT_DRV_INST(inst), pha, name, cell) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance's value within a phandle-array specifier by name.
| inst | instance number |
| pha | lowercase-and-underscores property with type "phandle-array" |
| name | lowercase-and-underscores name of a specifier in "pha" |
| cell | binding's cell name for the named specifier |
| #define DT_INST_PHA_BY_NAME_OR | ( | inst, | |
| pha, | |||
| name, | |||
| cell, | |||
| default_value | |||
| ) | DT_PHA_BY_NAME_OR(DT_DRV_INST(inst), pha, name, cell, default_value) |
#include <include/devicetree.h>
Like DT_INST_PHA_BY_NAME(), but with a fallback to default_value.
| inst | instance number |
| pha | lowercase-and-underscores property with type "phandle-array" |
| name | lowercase-and-underscores name of a specifier in "pha" |
| cell | binding's cell name for the named specifier |
| default_value | a fallback value to expand to |
| #define DT_INST_PHA_HAS_CELL | ( | inst, | |
| pha, | |||
| cell | |||
| ) | DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, 0, cell) |
#include <include/devicetree.h>
Does a phandle array have a named cell specifier at index 0 for a DT_DRV_COMPAT instance?
| inst | instance number |
| pha | lowercase-and-underscores property with type "phandle-array" |
| cell | named cell value whose existence to check |
| #define DT_INST_PHA_HAS_CELL_AT_IDX | ( | inst, | |
| pha, | |||
| idx, | |||
| cell | |||
| ) | DT_PHA_HAS_CELL_AT_IDX(DT_DRV_INST(inst), pha, idx, cell) |
#include <include/devicetree.h>
Does a phandle array have a named cell specifier at an index for a DT_DRV_COMPAT instance?
| inst | instance number |
| pha | lowercase-and-underscores property with type "phandle-array" |
| idx | index to check |
| cell | named cell value whose existence to check |
| #define DT_INST_PHA_OR | ( | inst, | |
| pha, | |||
| cell, | |||
| default_value | |||
| ) | DT_INST_PHA_BY_IDX_OR(inst, pha, 0, cell, default_value) |
#include <include/devicetree.h>
Like DT_INST_PHA(), but with a fallback to default_value.
| inst | instance number |
| pha | lowercase-and-underscores property with type "phandle-array" |
| cell | binding's cell name for the specifier at "pha" index 0 |
| default_value | a fallback value to expand to |
| #define DT_INST_PHANDLE | ( | inst, | |
| prop | |||
| ) | DT_INST_PHANDLE_BY_IDX(inst, prop, 0) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance's node identifier for a phandle property's value.
| inst | instance number |
| prop | lowercase-and-underscores property of "inst" with type "phandle" |
| #define DT_INST_PHANDLE_BY_IDX | ( | inst, | |
| prop, | |||
| idx | |||
| ) | DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), prop, idx) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance's node identifier for a phandle in a property.
| inst | instance number |
| prop | lowercase-and-underscores property name in "inst" with type "phandle", "phandles" or "phandle-array" |
| idx | index into "prop" |
| #define DT_INST_PHANDLE_BY_NAME | ( | inst, | |
| pha, | |||
| name | |||
| ) | DT_PHANDLE_BY_NAME(DT_DRV_INST(inst), pha, name) \ |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance's phandle node identifier from a phandle array by name.
| inst | instance number |
| pha | lowercase-and-underscores property with type "phandle-array" |
| name | lowercase-and-underscores name of an element in "pha" |
| #define DT_INST_PROP | ( | inst, | |
| prop | |||
| ) | DT_PROP(DT_DRV_INST(inst), prop) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance property.
| inst | instance number |
| prop | lowercase-and-underscores property name |
| #define DT_INST_PROP_BY_IDX | ( | inst, | |
| prop, | |||
| idx | |||
| ) | DT_PROP_BY_IDX(DT_DRV_INST(inst), prop, idx) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT element value in an array property.
| inst | instance number |
| prop | lowercase-and-underscores property name |
| idx | the index to get |
| #define DT_INST_PROP_BY_PHANDLE | ( | inst, | |
| ph, | |||
| prop | |||
| ) | DT_INST_PROP_BY_PHANDLE_IDX(inst, ph, 0, prop) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance's property value from a phandle's node.
| inst | instance number |
| ph | lowercase-and-underscores property of "inst" with type "phandle" |
| prop | lowercase-and-underscores property of the phandle's node |
| #define DT_INST_PROP_BY_PHANDLE_IDX | ( | inst, | |
| phs, | |||
| idx, | |||
| prop | |||
| ) | DT_PROP_BY_PHANDLE_IDX(DT_DRV_INST(inst), phs, idx, prop) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance's property value from a phandle in a property.
| inst | instance number |
| phs | lowercase-and-underscores property with type "phandle", "phandles", or "phandle-array" |
| idx | logical index into "phs", which must be zero if "phs" has type "phandle" |
| prop | lowercase-and-underscores property of the phandle's node |
| #define DT_INST_PROP_HAS_IDX | ( | inst, | |
| prop, | |||
| idx | |||
| ) | DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx) |
#include <include/devicetree.h>
Is index "idx" valid for an array type property on a DT_DRV_COMPAT instance?
| inst | instance number |
| prop | lowercase-and-underscores property name |
| idx | index to check |
| #define DT_INST_PROP_LEN | ( | inst, | |
| prop | |||
| ) | DT_PROP_LEN(DT_DRV_INST(inst), prop) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT property length.
| inst | instance number |
| prop | lowercase-and-underscores property name |
| #define DT_INST_PROP_OR | ( | inst, | |
| prop, | |||
| default_value | |||
| ) | DT_PROP_OR(DT_DRV_INST(inst), prop, default_value) |
#include <include/devicetree.h>
Like DT_INST_PROP(), but with a fallback to default_value.
| inst | instance number |
| prop | lowercase-and-underscores property name |
| default_value | a fallback value to expand to |
| #define DT_INST_REG_ADDR | ( | inst | ) | DT_INST_REG_ADDR_BY_IDX(inst, 0) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT's (only) register block address.
| inst | instance number |
| #define DT_INST_REG_ADDR_BY_IDX | ( | inst, | |
| idx | |||
| ) | DT_REG_ADDR_BY_IDX(DT_DRV_INST(inst), idx) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance's idx-th register block's address.
| inst | instance number |
| idx | index of the register whose address to return |
| #define DT_INST_REG_ADDR_BY_NAME | ( | inst, | |
| name | |||
| ) | DT_REG_ADDR_BY_NAME(DT_DRV_INST(inst), name) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT's register block address by name.
| inst | instance number |
| name | lowercase-and-underscores register specifier name |
| #define DT_INST_REG_HAS_IDX | ( | inst, | |
| idx | |||
| ) | DT_REG_HAS_IDX(DT_DRV_INST(inst), idx) |
#include <include/devicetree.h>
is "idx" a valid register block index on a DT_DRV_COMPAT instance?
| inst | instance number |
| idx | index to check |
| #define DT_INST_REG_SIZE | ( | inst | ) | DT_INST_REG_SIZE_BY_IDX(inst, 0) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT's (only) register block size.
| inst | instance number |
| #define DT_INST_REG_SIZE_BY_IDX | ( | inst, | |
| idx | |||
| ) | DT_REG_SIZE_BY_IDX(DT_DRV_INST(inst), idx) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT instance's idx-th register block's size.
| inst | instance number |
| idx | index of the register whose size to return |
| #define DT_INST_REG_SIZE_BY_NAME | ( | inst, | |
| name | |||
| ) | DT_REG_SIZE_BY_NAME(DT_DRV_INST(inst), name) |
#include <include/devicetree.h>
Get a DT_DRV_COMPAT's register block size by name.
| inst | instance number |
| name | lowercase-and-underscores register specifier name |