Zephyr API 3.6.99
Loading...
Searching...
No Matches

Macros

#define PINCTRL_DT_STATE_PINS_DEFINE(node_id, prop)
 Helper macro to define the pins of a pin control state from Devicetree.
 
#define PINCTRL_DT_STATE_INIT(prop, state)
 Utility macro to initialize a pin control state.
 

Functions

int pinctrl_update_states (struct pinctrl_dev_config *config, const struct pinctrl_state *states, uint8_t state_cnt)
 Update states with a new set.
 

Detailed Description

Macro Definition Documentation

◆ PINCTRL_DT_STATE_INIT

#define PINCTRL_DT_STATE_INIT ( prop,
state )

#include <zephyr/drivers/pinctrl.h>

Value:
{ \
.id = state, \
.pins = prop ## _pins, \
.pin_cnt = ARRAY_SIZE(prop ## _pins) \
}
#define ARRAY_SIZE(array)
Number of elements in the given array.
Definition util.h:127
state
Definition parser_state.h:29

Utility macro to initialize a pin control state.

This macro should be used in conjunction with PINCTRL_DT_STATE_PINS_DEFINE when using dynamic pin control to define an alternative state configuration stored in Devicetree.

Example:

// board.dts
/{
zephyr,user {
// uart0_alt_default node contains alternative pin config
uart0_alt_default = <&uart0_alt_default>;
};
};
// application
PINCTRL_DT_STATE_PINS_DEFINE(DT_PATH(zephyr_user), uart0_alt_default);
static const struct pinctrl_state uart0_alt[] = {
};
#define DT_PATH(...)
Get a node identifier for a devicetree path.
Definition devicetree.h:144
#define PINCTRL_DT_STATE_PINS_DEFINE(node_id, prop)
Helper macro to define the pins of a pin control state from Devicetree.
Definition pinctrl.h:376
#define PINCTRL_DT_STATE_INIT(prop, state)
Utility macro to initialize a pin control state.
Definition pinctrl.h:415
#define PINCTRL_STATE_DEFAULT
Default state (state used when the device is in operational state).
Definition pinctrl.h:42
Pin control state configuration.
Definition pinctrl.h:52
Parameters
propProperty name in Devicetree containing state configuration.
stateState represented by prop (see PINCTRL_STATES).
See also
PINCTRL_DT_STATE_PINS_DEFINE

◆ PINCTRL_DT_STATE_PINS_DEFINE

#define PINCTRL_DT_STATE_PINS_DEFINE ( node_id,
prop )

#include <zephyr/drivers/pinctrl.h>

Value:
static const pinctrl_soc_pin_t prop ## _pins[] = \
Z_PINCTRL_STATE_PINS_INIT(node_id, prop); \
Type for R-Car pin.
Definition pinctrl_rcar_common.h:38

Helper macro to define the pins of a pin control state from Devicetree.

The name of the defined state pins variable is the same used by prop. This macro is expected to be used in conjunction with PINCTRL_DT_STATE_INIT.

Parameters
node_idNode identifier containing prop.
propProperty within node_id containing state configuration.
See also
PINCTRL_DT_STATE_INIT

Function Documentation

◆ pinctrl_update_states()

int pinctrl_update_states ( struct pinctrl_dev_config * config,
const struct pinctrl_state * states,
uint8_t state_cnt )

#include <zephyr/drivers/pinctrl.h>

Update states with a new set.

Note
In order to guarantee device drivers correct operation the same states have to be provided. For example, if default and sleep are in the current list of states, it is expected that the new array of states also contains both.
Parameters
configPin control configuration.
statesNew states to be set.
state_cntNumber of new states to be set.
Return values
-EINVALIf the new configuration does not contain the same states as the current active configuration.
-ENOSYSIf the functionality is not available.
0On success.