Interfaces for pin controllers.
More...
|
file | pinctrl.h |
| Main header file for pin control driver API.
|
Interfaces for pin controllers.
- Since
- 3.0
- Version
- 0.1.0
◆ PINCTRL_DT_DEFINE
#define PINCTRL_DT_DEFINE |
( |
| node_id | ) |
|
#include <zephyr/drivers/pinctrl.h>
Value:
Z_PINCTRL_STATE_PINS_DEFINE, (;), node_id); \
Z_PINCTRL_STATES_DEFINE(node_id) \
Z_PINCTRL_DEV_CONFIG_STATIC Z_PINCTRL_DEV_CONFIG_CONST \
Z_PINCTRL_DEV_CONFIG_INIT(node_id)
#define DT_NUM_PINCTRL_STATES(node_id)
Get the number of pinctrl properties in a node.
Definition pinctrl.h:240
#define LISTIFY(LEN, F, sep,...)
Generates a sequence of code with configurable separator.
Definition util_macro.h:478
Pin controller configuration for a given device.
Definition pinctrl.h:63
Define all pin control information for the given node identifier.
This helper macro should be called together with device definition. It defines and initializes the pin control configuration for the device represented by node_id. Each pin control state (pinctrl-0, ..., pinctrl-N) is also defined and initialized. Note that states marked to be skipped will not be defined (refer to Z_PINCTRL_SKIP_STATE for more details).
- Parameters
-
◆ PINCTRL_DT_DEV_CONFIG_DECLARE
#define PINCTRL_DT_DEV_CONFIG_DECLARE |
( |
| node_id | ) |
|
#include <zephyr/drivers/pinctrl.h>
Value:
Z_PINCTRL_DEV_CONFIG_NAME(node_id)
Declare pin control configuration for a given node identifier.
This macro should be used by tests or applications using runtime pin control to declare the pin control configuration for a device. PINCTRL_DT_DEV_CONFIG_GET can later be used to obtain a reference to such configuration.
Only available if CONFIG_PINCTRL_NON_STATIC
is selected.
- Parameters
-
◆ PINCTRL_DT_DEV_CONFIG_GET
#define PINCTRL_DT_DEV_CONFIG_GET |
( |
| node_id | ) |
|
#include <zephyr/drivers/pinctrl.h>
Value:&Z_PINCTRL_DEV_CONFIG_NAME(node_id)
Obtain a reference to the pin control configuration given a node identifier.
- Parameters
-
◆ PINCTRL_DT_INST_DEFINE
#define PINCTRL_DT_INST_DEFINE |
( |
| inst | ) |
|
#include <zephyr/drivers/pinctrl.h>
Value:
#define DT_DRV_INST(inst)
Node identifier for an instance of a DT_DRV_COMPAT compatible.
Definition devicetree.h:4037
#define PINCTRL_DT_DEFINE(node_id)
Define all pin control information for the given node identifier.
Definition pinctrl.h:242
Define all pin control information for the given compatible index.
- Parameters
-
- See also
- PINCTRL_DT_DEFINE
◆ PINCTRL_DT_INST_DEV_CONFIG_GET
#define PINCTRL_DT_INST_DEV_CONFIG_GET |
( |
| inst | ) |
|
#include <zephyr/drivers/pinctrl.h>
Value:
#define PINCTRL_DT_DEV_CONFIG_GET(node_id)
Obtain a reference to the pin control configuration given a node identifier.
Definition pinctrl.h:265
Obtain a reference to the pin control configuration given current compatible instance number.
- Parameters
-
- See also
- PINCTRL_DT_DEV_CONFIG_GET
◆ PINCTRL_REG_NONE
#define PINCTRL_REG_NONE 0U |
◆ PINCTRL_STATE_DEFAULT
#define PINCTRL_STATE_DEFAULT 0U |
◆ PINCTRL_STATE_PRIV_START
#define PINCTRL_STATE_PRIV_START 2U |
◆ PINCTRL_STATE_SLEEP
#define PINCTRL_STATE_SLEEP 1U |
◆ pinctrl_apply_state()
#include <zephyr/drivers/pinctrl.h>
Apply a state from the given device configuration.
- Parameters
-
config | Pin control configuration. |
id | Id of the state to be applied (see PINCTRL_STATES). |
- Return values
-
0 | If succeeded. |
-ENOENT | If given state id does not exist. |
-errno | Negative errno for other failures. |
◆ pinctrl_apply_state_direct()
#include <zephyr/drivers/pinctrl.h>
Apply a state directly from the provided state configuration.
- Parameters
-
config | Pin control configuration. |
state | State. |
- Return values
-
0 | If succeeded |
-errno | Negative errno for other failures. |
◆ pinctrl_configure_pins()
#include <zephyr/drivers/pinctrl.h>
Configure a set of pins.
This function will configure the necessary hardware blocks to make the configuration immediately effective.
- Warning
- This function must never be used to configure pins used by an instantiated device driver.
- Parameters
-
pins | List of pins to be configured. |
pin_cnt | Number of pins. |
reg | Device register (optional, use PINCTRL_REG_NONE if not used). |
- Return values
-
0 | If succeeded |
-errno | Negative errno for other failures. |
◆ pinctrl_lookup_state()
#include <zephyr/drivers/pinctrl.h>
Find the state configuration for the given state id.
- Parameters
-
config | Pin controller configuration. |
id | Pin controller state id (see PINCTRL_STATES). |
state | Found state. |
- Return values
-
0 | If state has been found. |
-ENOENT | If the state has not been found. |