869ae2b5ac
It can be useful to know what a node's index is in its parent's list of children. This information is now available to C via gen_defines.py, but no user-facing macros are available to access it. Add a macro which exposes this information to users via devicetree.h. Some APIs want to build on devicetree.h by creating some derived structure for each of a node's children. It can therefore be convenient to use each child's index in the list of children as an identifier for the child. Some concrete and common examples are "gpio-keys" and "gpio-leds", which allow you to define arbitrary numbers of keys and LEDs as child nodes of nodes with those compatibles. Derived APIs can use a key or LED node's index in its list of parents as a way to identify which of several structures is relevant to a particular controlled key or LED. These are just examples, though -- the feature added here makes no assumptions about where it's being used. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no> |
||
---|---|---|
.. | ||
c_lib | ||
cbprintf_fp | ||
cbprintf_package | ||
cmsis_dsp | ||
cmsis_nn | ||
devicetree | ||
fdtable | ||
gui/lvgl | ||
heap | ||
heap_align | ||
icmsg | ||
json | ||
mem_alloc | ||
mem_blocks | ||
mpsc_pbuf | ||
newlib | ||
notify | ||
onoff | ||
p4workq | ||
ringbuffer | ||
smf | ||
sprintf | ||
sys_util | ||
time |