zephyr/include/devicetree
Martí Bolívar f4115423fa devicetree: add devicetree/pinctrl.h
This contains accessor macros for getting phandles out of pinctrl
properties by name and index. As usual, the representation in C for a
phandle is a node identifier.

Add these new macros:

- DT_PINCTRL_BY_IDX(node_id, pc_idx, idx): phandle at index idx
  in the pinctrl-<pc_idx> property

- DT_PINCTRL_0(node_id, idx): pinctrl-0 convenience for the same

- DT_PINCTRL_BY_NAME(node_id, name, idx): phandle at index idx
  in the pinctrl property named 'name'

- DT_PINCTRL_NAME_TO_IDX(node_id, name): convert a pinctrl property
  name to its index number

- DT_NUM_PINCTRLS_BY_IDX(node_id, pc_idx): number of phandles in
  pinctrl-<pc_idx>

- DT_NUM_PINCTRLS_BY_NAME(node_id, name): number of phandles in a
  named pinctrl property

- DT_NUM_PINCTRL_STATES(node_id): total number of pinctrl-<pc_idx>
  properties

- DT_PINCTRL_HAS_IDX(node_id, pc_idx): does pinctrl-<pc_idx> exist?

- DT_PINCTRL_HAS_NAME(node_id, name): does a named pinctrl property
  exist?

- DT_PINCTRL_IDX_TO_NAME_TOKEN(node_id, pc_idx): convert a pinctrl
  index to its name as a token, similar to DT_STRING_TOKEN()

- DT_PINCTRL_IDX_TO_NAME_UPPER_TOKEN(node_id, pc_idx): like
  DT_PINCTRL_IDX_TO_NAME_TOKEN, but with an uppercase result

As well as DT_DRV_INST equivalents, which take inst wherever node_id
appears above:

- DT_INST_PINCTRL_BY_IDX()
- DT_INST_PINCTRL_0()
- DT_INST_PINCTRL_BY_NAME()
- DT_INST_PINCTRL_NAME_TO_IDX()
- DT_INST_NUM_PINCTRLS_BY_IDX()
- DT_INST_NUM_PINCTRLS_BY_NAME()
- DT_INST_NUM_PINCTRL_STATES()
- DT_INST_PINCTRL_HAS_IDX()
- DT_INST_PINCTRL_HAS_NAME()
- DT_INST_PINCTRL_IDX_TO_NAME_TOKEN()
- DT_INST_PINCTRL_IDX_TO_NAME_UPPER_TOKEN()

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-25 18:09:00 -04:00
..
clocks.h devicetree: deprecate DT_CLOCKS_LABEL APIs 2021-02-22 12:20:33 -06:00
dma.h devicetree: deprecate DT_DMAS_LABEL APIs 2021-03-18 06:20:27 -05:00
fixed-partitions.h fs: provide access to DT-defined mount structures 2020-12-27 18:16:20 +01:00
gpio.h devicetree: fix DT_GPIO_CTLR docstring 2021-01-16 08:09:51 -06:00
io-channels.h devicetree: deprecate DT_IO_CHANNELS_LABEL APIs 2021-03-02 11:28:30 -06:00
memory.h reserved-memory: Introduce support for reserved-memory node 2021-07-15 18:12:51 -05:00
ordinals.h devicetree: add first round of dependency ordinal info 2020-10-14 13:18:44 -05:00
pinctrl.h devicetree: add devicetree/pinctrl.h 2021-08-25 18:09:00 -04:00
pwms.h devicetree: deprecate DT_PWMS_LABEL APIs 2021-02-24 13:45:46 -06:00
spi.h devicetree: spi: clean up DT_SPI_DEV_CS_GPIOS_CTLR 2021-03-30 07:06:48 -05:00
zephyr.h can: dts: Convert can-primary alias to zephyr,can-primary chosen prop 2020-04-29 14:27:31 -05:00