Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pinctrl.h File Reference
#include <device.h>
#include <devicetree.h>
#include <devicetree/pinctrl.h>
#include <pinctrl_soc.h>
#include <sys/util.h>

Go to the source code of this file.

Data Structures

struct  pinctrl_state
 
struct  pinctrl_dev_config
 

Macros

#define PINCTRL_REG_NONE   0U
 
#define PINCTRL_DT_DEV_CONFIG_DECLARE(node_id)
 Declare pin control configuration for a given node identifier. More...
 
#define PINCTRL_DT_DEFINE(node_id)
 Define all pin control information for the given node identifier. More...
 
#define PINCTRL_DT_INST_DEFINE(inst)   PINCTRL_DT_DEFINE(DT_DRV_INST(inst))
 Define all pin control information for the given compatible index. More...
 
#define PINCTRL_DT_DEV_CONFIG_GET(node_id)   &Z_PINCTRL_DEV_CONFIG_NAME(node_id)
 Obtain a reference to the pin control configuration given a node identifier. More...
 
#define PINCTRL_DT_INST_DEV_CONFIG_GET(inst)    PINCTRL_DT_DEV_CONFIG_GET(DT_DRV_INST(inst))
 Obtain a reference to the pin control configuration given current compatible instance number. More...
 
#define PINCTRL_DT_STATE_PINS_DEFINE(node_id, prop)
 Helper macro to define the pins of a pin control state from Devicetree. More...
 
#define PINCTRL_DT_STATE_INIT(prop, state)
 Utility macro to initialize a pin control state. More...
 
Pin control states

#define PINCTRL_STATE_DEFAULT   0U
 
#define PINCTRL_STATE_SLEEP   1U
 
#define PINCTRL_STATE_PRIV_START   2U
 

Functions

int pinctrl_lookup_state (const struct pinctrl_dev_config *config, uint8_t id, const struct pinctrl_state **state)
 Find the state configuration for the given state id. More...
 
int pinctrl_configure_pins (const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintptr_t reg)
 Configure a set of pins. More...
 
static int pinctrl_apply_state_direct (const struct pinctrl_dev_config *config, const struct pinctrl_state *state)
 Apply a state directly from the provided state configuration. More...
 
static int pinctrl_apply_state (const struct pinctrl_dev_config *config, uint8_t id)
 Apply a state from the given device configuration. More...
 
int pinctrl_update_states (struct pinctrl_dev_config *config, const struct pinctrl_state *states, uint8_t state_cnt)
 Update states with a new set. More...
 

Detailed Description

Public APIs for pin control drivers