Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
pinctrl.h File Reference

Devicetree pin control helpers. More...

Go to the source code of this file.

Macros

#define DT_PINCTRL_BY_IDX(node_id, pc_idx, idx)    DT_CAT6(node_id, _P_pinctrl_, pc_idx, _IDX_, idx, _PH)
 Get a node identifier for a phandle in a pinctrl property by index.
 
#define DT_PINCTRL_0(node_id, idx)   DT_PINCTRL_BY_IDX(node_id, 0, idx)
 Get a node identifier from a pinctrl-0 property.
 
#define DT_PINCTRL_BY_NAME(node_id, name, idx)    DT_CAT6(node_id, _PINCTRL_NAME_, name, _IDX_, idx, _PH)
 Get a node identifier for a phandle inside a pinctrl node by name.
 
#define DT_PINCTRL_NAME_TO_IDX(node_id, name)    DT_CAT4(node_id, _PINCTRL_NAME_, name, _IDX)
 Convert a pinctrl name to its corresponding index.
 
#define DT_PINCTRL_IDX_TO_NAME_TOKEN(node_id, pc_idx)    DT_CAT4(node_id, _PINCTRL_IDX_, pc_idx, _TOKEN)
 Convert a pinctrl property index to its name as a token.
 
#define DT_PINCTRL_IDX_TO_NAME_UPPER_TOKEN(node_id, pc_idx)    DT_CAT4(node_id, _PINCTRL_IDX_, pc_idx, _UPPER_TOKEN)
 Like DT_PINCTRL_IDX_TO_NAME_TOKEN(), but with an uppercased result.
 
#define DT_NUM_PINCTRLS_BY_IDX(node_id, pc_idx)    DT_CAT4(node_id, _P_pinctrl_, pc_idx, _LEN)
 Get the number of phandles in a pinctrl property.
 
#define DT_NUM_PINCTRLS_BY_NAME(node_id, name)    DT_NUM_PINCTRLS_BY_IDX(node_id, DT_PINCTRL_NAME_TO_IDX(node_id, name))
 Like DT_NUM_PINCTRLS_BY_IDX(), but by name instead.
 
#define DT_NUM_PINCTRL_STATES(node_id)   DT_CAT(node_id, _PINCTRL_NUM)
 Get the number of pinctrl properties in a node.
 
#define DT_PINCTRL_HAS_IDX(node_id, pc_idx)    IS_ENABLED(DT_CAT4(node_id, _PINCTRL_IDX_, pc_idx, _EXISTS))
 Test if a node has a pinctrl property with an index.
 
#define DT_PINCTRL_HAS_NAME(node_id, name)    IS_ENABLED(DT_CAT4(node_id, _PINCTRL_NAME_, name, _EXISTS))
 Test if a node has a pinctrl property with a name.
 
#define DT_INST_PINCTRL_BY_IDX(inst, pc_idx, idx)    DT_PINCTRL_BY_IDX(DT_DRV_INST(inst), pc_idx, idx)
 Get a node identifier for a phandle in a pinctrl property by index for a DT_DRV_COMPAT instance.
 
#define DT_INST_PINCTRL_0(inst, idx)    DT_PINCTRL_BY_IDX(DT_DRV_INST(inst), 0, idx)
 Get a node identifier from a pinctrl-0 property for a DT_DRV_COMPAT instance.
 
#define DT_INST_PINCTRL_BY_NAME(inst, name, idx)    DT_PINCTRL_BY_NAME(DT_DRV_INST(inst), name, idx)
 Get a node identifier for a phandle inside a pinctrl node for a DT_DRV_COMPAT instance.
 
#define DT_INST_PINCTRL_NAME_TO_IDX(inst, name)    DT_PINCTRL_NAME_TO_IDX(DT_DRV_INST(inst), name)
 Convert a pinctrl name to its corresponding index for a DT_DRV_COMPAT instance.
 
#define DT_INST_PINCTRL_IDX_TO_NAME_TOKEN(inst, pc_idx)    DT_PINCTRL_IDX_TO_NAME_TOKEN(DT_DRV_INST(inst), pc_idx)
 Convert a pinctrl index to its name as an uppercased token.
 
#define DT_INST_PINCTRL_IDX_TO_NAME_UPPER_TOKEN(inst, pc_idx)    DT_PINCTRL_IDX_TO_NAME_UPPER_TOKEN(DT_DRV_INST(inst), pc_idx)
 Convert a pinctrl index to its name as an uppercased token.
 
#define DT_INST_NUM_PINCTRLS_BY_IDX(inst, pc_idx)    DT_NUM_PINCTRLS_BY_IDX(DT_DRV_INST(inst), pc_idx)
 Get the number of phandles in a pinctrl property for a DT_DRV_COMPAT instance.
 
#define DT_INST_NUM_PINCTRLS_BY_NAME(inst, name)    DT_NUM_PINCTRLS_BY_NAME(DT_DRV_INST(inst), name)
 Like DT_INST_NUM_PINCTRLS_BY_IDX(), but by name instead.
 
#define DT_INST_NUM_PINCTRL_STATES(inst)    DT_NUM_PINCTRL_STATES(DT_DRV_INST(inst))
 Get the number of pinctrl properties in a DT_DRV_COMPAT instance.
 
#define DT_INST_PINCTRL_HAS_IDX(inst, pc_idx)    DT_PINCTRL_HAS_IDX(DT_DRV_INST(inst), pc_idx)
 Test if a DT_DRV_COMPAT instance has a pinctrl property with an index.
 
#define DT_INST_PINCTRL_HAS_NAME(inst, name)    DT_PINCTRL_HAS_NAME(DT_DRV_INST(inst), name)
 Test if a DT_DRV_COMPAT instance has a pinctrl property with a name.
 

Detailed Description

Devicetree pin control helpers.