15#ifndef ZEPHYR_INCLUDE_DRIVERS_GPIO_H_
16#define ZEPHYR_INCLUDE_DRIVERS_GPIO_H_
48#define GPIO_INPUT (1U << 16)
51#define GPIO_OUTPUT (1U << 17)
54#define GPIO_DISCONNECTED 0
59#define GPIO_OUTPUT_INIT_LOW (1U << 18)
62#define GPIO_OUTPUT_INIT_HIGH (1U << 19)
65#define GPIO_OUTPUT_INIT_LOGICAL (1U << 20)
70#define GPIO_OUTPUT_LOW (GPIO_OUTPUT | GPIO_OUTPUT_INIT_LOW)
72#define GPIO_OUTPUT_HIGH (GPIO_OUTPUT | GPIO_OUTPUT_INIT_HIGH)
74#define GPIO_OUTPUT_INACTIVE (GPIO_OUTPUT | \
75 GPIO_OUTPUT_INIT_LOW | \
76 GPIO_OUTPUT_INIT_LOGICAL)
78#define GPIO_OUTPUT_ACTIVE (GPIO_OUTPUT | \
79 GPIO_OUTPUT_INIT_HIGH | \
80 GPIO_OUTPUT_INIT_LOGICAL)
101#define GPIO_INT_DISABLE (1U << 21)
106#define GPIO_INT_ENABLE (1U << 22)
113#define GPIO_INT_LEVELS_LOGICAL (1U << 23)
122#define GPIO_INT_EDGE (1U << 24)
130#define GPIO_INT_LOW_0 (1U << 25)
138#define GPIO_INT_HIGH_1 (1U << 26)
140#ifdef CONFIG_GPIO_ENABLE_DISABLE_INTERRUPT
147#define GPIO_INT_ENABLE_DISABLE_ONLY (1u << 27)
150#define GPIO_INT_MASK (GPIO_INT_DISABLE | \
152 GPIO_INT_LEVELS_LOGICAL | \
161#define GPIO_INT_EDGE_RISING (GPIO_INT_ENABLE | \
168#define GPIO_INT_EDGE_FALLING (GPIO_INT_ENABLE | \
175#define GPIO_INT_EDGE_BOTH (GPIO_INT_ENABLE | \
183#define GPIO_INT_LEVEL_LOW (GPIO_INT_ENABLE | \
189#define GPIO_INT_LEVEL_HIGH (GPIO_INT_ENABLE | \
195#define GPIO_INT_EDGE_TO_INACTIVE (GPIO_INT_ENABLE | \
196 GPIO_INT_LEVELS_LOGICAL | \
203#define GPIO_INT_EDGE_TO_ACTIVE (GPIO_INT_ENABLE | \
204 GPIO_INT_LEVELS_LOGICAL | \
211#define GPIO_INT_LEVEL_INACTIVE (GPIO_INT_ENABLE | \
212 GPIO_INT_LEVELS_LOGICAL | \
218#define GPIO_INT_LEVEL_ACTIVE (GPIO_INT_ENABLE | \
219 GPIO_INT_LEVELS_LOGICAL | \
225#define GPIO_DIR_MASK (GPIO_INPUT | GPIO_OUTPUT)
332#define GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, idx) \
334 .port = DEVICE_DT_GET(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx)),\
335 .pin = DT_GPIO_PIN_BY_IDX(node_id, prop, idx), \
336 .dt_flags = DT_GPIO_FLAGS_BY_IDX(node_id, prop, idx), \
356#define GPIO_DT_SPEC_GET_BY_IDX_OR(node_id, prop, idx, default_value) \
357 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
358 (GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, idx)), \
369#define GPIO_DT_SPEC_GET(node_id, prop) \
370 GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, 0)
382#define GPIO_DT_SPEC_GET_OR(node_id, prop, default_value) \
383 GPIO_DT_SPEC_GET_BY_IDX_OR(node_id, prop, 0, default_value)
395#define GPIO_DT_SPEC_INST_GET_BY_IDX(inst, prop, idx) \
396 GPIO_DT_SPEC_GET_BY_IDX(DT_DRV_INST(inst), prop, idx)
409#define GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, prop, idx, default_value) \
410 COND_CODE_1(DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx), \
411 (GPIO_DT_SPEC_GET_BY_IDX(DT_DRV_INST(inst), prop, idx)), \
422#define GPIO_DT_SPEC_INST_GET(inst, prop) \
423 GPIO_DT_SPEC_INST_GET_BY_IDX(inst, prop, 0)
435#define GPIO_DT_SPEC_INST_GET_OR(inst, prop, default_value) \
436 GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, prop, 0, default_value)
452#define Z_GPIO_GEN_BITMASK_COND(node_id, prop, off_idx, sz_idx) \
453 COND_CODE_1(DT_PROP_HAS_IDX(node_id, prop, off_idx), \
454 (COND_CODE_0(DT_PROP_BY_IDX(node_id, prop, sz_idx), \
456 (GENMASK64(DT_PROP_BY_IDX(node_id, prop, off_idx) + \
457 DT_PROP_BY_IDX(node_id, prop, sz_idx) - 1, \
458 DT_PROP_BY_IDX(node_id, prop, off_idx)))) \
468#define Z_GPIO_GEN_RESERVED_RANGES_COND(odd_it, node_id) \
469 COND_CODE_1(DT_PROP_HAS_IDX(node_id, gpio_reserved_ranges, odd_it), \
470 (Z_GPIO_GEN_BITMASK_COND(node_id, \
471 gpio_reserved_ranges, \
472 GET_ARG_N(odd_it, Z_SPARSE_LIST_EVEN_NUMBERS), \
567#define GPIO_DT_RESERVED_RANGES_NGPIOS(node_id, ngpios) \
568 ((gpio_port_pins_t) \
569 COND_CODE_1(DT_NODE_HAS_PROP(node_id, gpio_reserved_ranges), \
570 (GENMASK64(BITS_PER_LONG_LONG - 1, ngpios) \
571 | FOR_EACH_FIXED_ARG(Z_GPIO_GEN_RESERVED_RANGES_COND, \
574 LIST_DROP_EMPTY(Z_SPARSE_LIST_ODD_NUMBERS))), \
584#define GPIO_DT_RESERVED_RANGES(node_id) \
585 GPIO_DT_RESERVED_RANGES_NGPIOS(node_id, DT_PROP(node_id, ngpios))
596#define GPIO_DT_INST_RESERVED_RANGES_NGPIOS(inst, ngpios) \
597 GPIO_DT_RESERVED_RANGES_NGPIOS(DT_DRV_INST(inst), ngpios)
607#define GPIO_DT_INST_RESERVED_RANGES(inst) \
608 GPIO_DT_RESERVED_RANGES(DT_DRV_INST(inst))
658#define GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(node_id, ngpios) \
659 ((gpio_port_pins_t) \
660 COND_CODE_0(ngpios, \
662 (COND_CODE_1(DT_NODE_HAS_PROP(node_id, gpio_reserved_ranges), \
663 ((GENMASK64(ngpios - 1, 0) & \
664 ~GPIO_DT_RESERVED_RANGES_NGPIOS(node_id, ngpios))), \
665 (GENMASK64(ngpios - 1, 0))) \
678#define GPIO_DT_INST_PORT_PIN_MASK_NGPIOS_EXC(inst, ngpios) \
679 GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(DT_DRV_INST(inst), ngpios)
684#define GPIO_MAX_PINS_PER_PORT (sizeof(gpio_port_pins_t) * __CHAR_BIT__)
771 GPIO_INT_MODE_LEVEL = GPIO_INT_ENABLE,
772 GPIO_INT_MODE_EDGE = GPIO_INT_ENABLE | GPIO_INT_EDGE,
773#ifdef CONFIG_GPIO_ENABLE_DISABLE_INTERRUPT
774 GPIO_INT_MODE_DISABLE_ONLY =
GPIO_INT_DISABLE | GPIO_INT_ENABLE_DISABLE_ONLY,
775 GPIO_INT_MODE_ENABLE_ONLY = GPIO_INT_ENABLE | GPIO_INT_ENABLE_DISABLE_ONLY,
783 GPIO_INT_TRIG_LOW = GPIO_INT_LOW_0,
786 GPIO_INT_TRIG_HIGH = GPIO_INT_HIGH_1,
788 GPIO_INT_TRIG_BOTH = GPIO_INT_LOW_0 | GPIO_INT_HIGH_1,
793__subsystem
struct gpio_driver_api {
796#ifdef CONFIG_GPIO_GET_CONFIG
800 int (*port_get_raw)(
const struct device *port,
802 int (*port_set_masked_raw)(
const struct device *port,
805 int (*port_set_bits_raw)(
const struct device *port,
807 int (*port_clear_bits_raw)(
const struct device *port,
809 int (*port_toggle_bits)(
const struct device *port,
811 int (*pin_interrupt_configure)(
const struct device *port,
813 enum gpio_int_mode,
enum gpio_int_trig);
814 int (*manage_callback)(
const struct device *port,
818#ifdef CONFIG_GPIO_GET_DIRECTION
869static inline int z_impl_gpio_pin_interrupt_configure(
const struct device *port,
873 const struct gpio_driver_api *api =
874 (
const struct gpio_driver_api *)port->
api;
879 enum gpio_int_trig trig;
880 enum gpio_int_mode mode;
885 if (api->pin_interrupt_configure == NULL) {
892 "Cannot both enable and disable interrupts");
895 "Must either enable or disable interrupts");
897 __ASSERT(((
flags & GPIO_INT_ENABLE) == 0) ||
898 ((
flags & GPIO_INT_EDGE) != 0) ||
899 ((
flags & (GPIO_INT_LOW_0 | GPIO_INT_HIGH_1)) !=
900 (GPIO_INT_LOW_0 | GPIO_INT_HIGH_1)),
901 "Only one of GPIO_INT_LOW_0, GPIO_INT_HIGH_1 can be "
902 "enabled for a level interrupt.");
904 __ASSERT(((
flags & GPIO_INT_ENABLE) == 0) ||
905#ifdef CONFIG_GPIO_ENABLE_DISABLE_INTERRUPT
906 ((
flags & (GPIO_INT_LOW_0 | GPIO_INT_HIGH_1)) != 0) ||
907 (
flags & GPIO_INT_ENABLE_DISABLE_ONLY) != 0,
909 ((
flags & (GPIO_INT_LOW_0 | GPIO_INT_HIGH_1)) != 0),
911 "At least one of GPIO_INT_LOW_0, GPIO_INT_HIGH_1 has to be "
917 if (((
flags & GPIO_INT_LEVELS_LOGICAL) != 0) &&
920 flags ^= (GPIO_INT_LOW_0 | GPIO_INT_HIGH_1);
924#ifdef CONFIG_GPIO_ENABLE_DISABLE_INTERRUPT
926 GPIO_INT_ENABLE_DISABLE_ONLY));
931 ret = api->pin_interrupt_configure(port, pin, mode, trig);
976static inline int z_impl_gpio_pin_configure(
const struct device *port,
980 const struct gpio_driver_api *api =
981 (
const struct gpio_driver_api *)port->
api;
990 __ASSERT((
flags & GPIO_INT_MASK) == 0,
991 "Interrupt flags are not supported");
995 "Pull Up and Pull Down should not be enabled simultaneously");
998 "Input cannot be enabled for 'Open Drain', 'Open Source' modes without Output");
1000 __ASSERT_NO_MSG((
flags & GPIO_SINGLE_ENDED) != 0 ||
1001 (
flags & GPIO_LINE_OPEN_DRAIN) == 0);
1003 __ASSERT((
flags & (GPIO_OUTPUT_INIT_LOW | GPIO_OUTPUT_INIT_HIGH)) == 0
1005 "Output needs to be enabled to be initialized low or high");
1007 __ASSERT((
flags & (GPIO_OUTPUT_INIT_LOW | GPIO_OUTPUT_INIT_HIGH))
1008 != (GPIO_OUTPUT_INIT_LOW | GPIO_OUTPUT_INIT_HIGH),
1009 "Output cannot be initialized low and high");
1011 if (((
flags & GPIO_OUTPUT_INIT_LOGICAL) != 0)
1012 && ((
flags & (GPIO_OUTPUT_INIT_LOW | GPIO_OUTPUT_INIT_HIGH)) != 0)
1014 flags ^= GPIO_OUTPUT_INIT_LOW | GPIO_OUTPUT_INIT_HIGH;
1017 flags &= ~GPIO_OUTPUT_INIT_LOGICAL;
1028 ret = api->pin_configure(port, pin,
flags);
1073#ifdef CONFIG_GPIO_GET_DIRECTION
1078 const struct gpio_driver_api *api = (
const struct gpio_driver_api *)port->
api;
1083 if (api->port_get_direction == NULL) {
1088 ret = api->port_get_direction(port, map, inputs, outputs);
1202#ifdef CONFIG_GPIO_GET_CONFIG
1203static inline int z_impl_gpio_pin_get_config(
const struct device *port,
1207 const struct gpio_driver_api *api =
1208 (
const struct gpio_driver_api *)port->
api;
1213 if (api->pin_get_config == NULL) {
1218 ret = api->pin_get_config(port, pin,
flags);
1264 const struct gpio_driver_api *api = (
const struct gpio_driver_api *)port->
api;
1269 ret = api->port_get_raw(port, value);
1328static inline int z_impl_gpio_port_set_masked_raw(
const struct device *port,
1332 const struct gpio_driver_api *api =
1333 (
const struct gpio_driver_api *)port->
api;
1338 ret = api->port_set_masked_raw(port, mask, value);
1388static inline int z_impl_gpio_port_set_bits_raw(
const struct device *port,
1391 const struct gpio_driver_api *api =
1392 (
const struct gpio_driver_api *)port->
api;
1397 ret = api->port_set_bits_raw(port, pins);
1431static inline int z_impl_gpio_port_clear_bits_raw(
const struct device *port,
1434 const struct gpio_driver_api *api =
1435 (
const struct gpio_driver_api *)port->
api;
1440 ret = api->port_clear_bits_raw(port, pins);
1474static inline int z_impl_gpio_port_toggle_bits(
const struct device *port,
1477 const struct gpio_driver_api *api =
1478 (
const struct gpio_driver_api *)port->
api;
1483 ret = api->port_toggle_bits(port, pins);
1503 __ASSERT((set_pins & clear_pins) == 0,
"Set and Clear pins overlap");
1523 __ASSERT((set_pins & clear_pins) == 0,
"Set and Clear pins overlap");
1680 value = (value != 0) ? 0 : 1;
1750 __ASSERT(callback,
"Callback pointer should not be NULL");
1751 __ASSERT(handler,
"Callback handler pointer should not be NULL");
1776 const struct gpio_driver_api *api =
1777 (
const struct gpio_driver_api *)port->
api;
1782 if (api->manage_callback == NULL) {
1787 ret = api->manage_callback(port, callback,
true);
1830 const struct gpio_driver_api *api =
1831 (
const struct gpio_driver_api *)port->
api;
1836 if (api->manage_callback == NULL) {
1841 ret = api->manage_callback(port, callback,
false);
1879static inline int z_impl_gpio_get_pending_int(
const struct device *dev)
1881 const struct gpio_driver_api *api =
1882 (
const struct gpio_driver_api *)dev->
api;
1887 if (api->get_pending_int == NULL) {
1892 ret = api->get_pending_int(dev);
1905#include <zephyr/syscalls/gpio.h>
bool device_is_ready(const struct device *dev)
Verify that a device is ready for use.
static int gpio_add_callback(const struct device *port, struct gpio_callback *callback)
Add an application callback.
Definition gpio.h:1773
#define GPIO_OUTPUT
Enables pin as output, no change to the output state.
Definition gpio.h:51
static int gpio_pin_get_raw(const struct device *port, gpio_pin_t pin)
Get physical level of an input pin.
Definition gpio.h:1543
int gpio_pin_get_config(const struct device *port, gpio_pin_t pin, gpio_flags_t *flags)
Get a configuration of a single pin.
static int gpio_pin_is_input(const struct device *port, gpio_pin_t pin)
Check if pin is configured for input.
Definition gpio.h:1106
static int gpio_pin_get(const struct device *port, gpio_pin_t pin)
Get logical level of an input pin.
Definition gpio.h:1580
int gpio_port_set_bits_raw(const struct device *port, gpio_port_pins_t pins)
Set physical level of selected output pins to high.
static int gpio_pin_is_output_dt(const struct gpio_dt_spec *spec)
Check if a single pin from gpio_dt_spec is configured for output.
Definition gpio.h:1179
static int gpio_pin_interrupt_configure_dt(const struct gpio_dt_spec *spec, gpio_flags_t flags)
Configure pin interrupts from a gpio_dt_spec.
Definition gpio.h:951
static int gpio_remove_callback_dt(const struct gpio_dt_spec *spec, struct gpio_callback *callback)
Remove an application callback.
Definition gpio.h:1857
static int gpio_pin_toggle_dt(const struct gpio_dt_spec *spec)
Toggle pin level from a gpio_dt_spec.
Definition gpio.h:1733
uint8_t gpio_pin_t
Provides a type to hold a GPIO pin index.
Definition gpio.h:255
static int gpio_pin_is_output(const struct device *port, gpio_pin_t pin)
Check if pin is configured for output.
Definition gpio.h:1151
int gpio_get_pending_int(const struct device *dev)
Function to get pending interrupts.
static int gpio_pin_configure_dt(const struct gpio_dt_spec *spec, gpio_flags_t extra_flags)
Configure a single pin from a gpio_dt_spec and some extra flags.
Definition gpio.h:1044
static int gpio_pin_set_dt(const struct gpio_dt_spec *spec, int value)
Set logical level of a output pin from a gpio_dt_spec.
Definition gpio.h:1697
static int gpio_add_callback_dt(const struct gpio_dt_spec *spec, struct gpio_callback *callback)
Add an application callback.
Definition gpio.h:1803
static int gpio_port_set_bits(const struct device *port, gpio_port_pins_t pins)
Set logical level of selected output pins to active.
Definition gpio.h:1412
uint32_t gpio_flags_t
Provides a type to hold GPIO configuration flags.
Definition gpio.h:275
#define GPIO_ACTIVE_LOW
GPIO pin is active (has logical value '1') in low state.
Definition gpio.h:26
#define GPIO_INT_WAKEUP
Configures GPIO interrupt to wakeup the system from low power mode.
Definition gpio.h:85
static int gpio_port_set_clr_bits_raw(const struct device *port, gpio_port_pins_t set_pins, gpio_port_pins_t clear_pins)
Set physical level of selected output pins.
Definition gpio.h:1499
static int gpio_port_set_clr_bits(const struct device *port, gpio_port_pins_t set_pins, gpio_port_pins_t clear_pins)
Set logical level of selected output pins.
Definition gpio.h:1519
static void gpio_init_callback(struct gpio_callback *callback, gpio_callback_handler_t handler, gpio_port_pins_t pin_mask)
Helper to initialize a struct gpio_callback properly.
Definition gpio.h:1744
static int gpio_pin_is_input_dt(const struct gpio_dt_spec *spec)
Check if a single pin from gpio_dt_spec is configured for input.
Definition gpio.h:1134
#define GPIO_INPUT
Enables pin as input.
Definition gpio.h:48
uint32_t gpio_port_pins_t
Identifies a set of pins associated with a port.
Definition gpio.h:234
static int gpio_pin_get_config_dt(const struct gpio_dt_spec *spec, gpio_flags_t *flags)
Get a configuration of a single pin from a gpio_dt_spec.
Definition gpio.h:1236
int gpio_port_toggle_bits(const struct device *port, gpio_port_pins_t pins)
Toggle level of selected output pins.
#define GPIO_INT_DISABLE
Disables GPIO pin interrupt.
Definition gpio.h:101
int gpio_pin_interrupt_configure(const struct device *port, gpio_pin_t pin, gpio_flags_t flags)
Configure pin interrupt.
int gpio_port_clear_bits_raw(const struct device *port, gpio_port_pins_t pins)
Set physical level of selected output pins to low.
int gpio_port_set_masked_raw(const struct device *port, gpio_port_pins_t mask, gpio_port_value_t value)
Set physical level of output pins in a port.
#define GPIO_PULL_UP
Enables GPIO pin pull-up.
Definition gpio.h:75
static int gpio_pin_get_dt(const struct gpio_dt_spec *spec)
Get logical level of an input pin from a gpio_dt_spec.
Definition gpio.h:1608
static int gpio_pin_toggle(const struct device *port, gpio_pin_t pin)
Toggle pin level.
Definition gpio.h:1712
static bool gpio_is_ready_dt(const struct gpio_dt_spec *spec)
Validate that GPIO port is ready.
Definition gpio.h:836
uint32_t gpio_port_value_t
Provides values for a set of pins associated with a port.
Definition gpio.h:247
static int gpio_pin_set(const struct device *port, gpio_pin_t pin, int value)
Set logical level of an output pin.
Definition gpio.h:1668
static int gpio_port_clear_bits(const struct device *port, gpio_port_pins_t pins)
Set logical level of selected output pins to inactive.
Definition gpio.h:1455
static int gpio_remove_callback(const struct device *port, struct gpio_callback *callback)
Remove an application callback.
Definition gpio.h:1827
static int gpio_port_set_masked(const struct device *port, gpio_port_pins_t mask, gpio_port_value_t value)
Set logical level of output pins in a port.
Definition gpio.h:1363
int gpio_port_get_direction(const struct device *port, gpio_port_pins_t map, gpio_port_pins_t *inputs, gpio_port_pins_t *outputs)
Get direction of select pins in a port.
uint16_t gpio_dt_flags_t
Provides a type to hold GPIO devicetree flags.
Definition gpio.h:267
#define GPIO_PULL_DOWN
Enable GPIO pin pull-down.
Definition gpio.h:78
static int gpio_pin_set_raw(const struct device *port, gpio_pin_t pin, int value)
Set physical level of an output pin.
Definition gpio.h:1628
int gpio_port_get_raw(const struct device *port, gpio_port_value_t *value)
Get physical level of all input pins in a port.
static int gpio_port_get(const struct device *port, gpio_port_value_t *value)
Get logical level of all input pins in a port.
Definition gpio.h:1292
int gpio_pin_configure(const struct device *port, gpio_pin_t pin, gpio_flags_t flags)
Configure a single pin.
void(* gpio_callback_handler_t)(const struct device *port, struct gpio_callback *cb, gpio_port_pins_t pins)
Define the application callback handler function signature.
Definition gpio.h:727
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
#define SYS_PORT_TRACING_FUNC_ENTER(type, func,...)
Tracing macro for the entry into a function that might or might not return a value.
Definition tracing_macros.h:248
#define SYS_PORT_TRACING_FUNC_EXIT(type, func,...)
Tracing macro for when a function ends its execution.
Definition tracing_macros.h:274
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
#define ENOSYS
Function not implemented.
Definition errno.h:82
flags
Definition parser.h:96
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:411
void * data
Address of the device instance private data.
Definition device.h:421
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:417
const void * config
Address of device instance config information.
Definition device.h:415
GPIO callback structure.
Definition gpio.h:741
sys_snode_t node
This is meant to be used in the driver and the user should not mess with it (see drivers/gpio/gpio_ut...
Definition gpio.h:745
gpio_port_pins_t pin_mask
A mask of pins the callback is interested in, if 0 the callback will never be called.
Definition gpio.h:756
gpio_callback_handler_t handler
Actual callback function being called when relevant.
Definition gpio.h:748
This structure is common to all GPIO drivers and is expected to be the first element in the object po...
Definition gpio.h:691
gpio_port_pins_t port_pin_mask
Mask identifying pins supported by the controller.
Definition gpio.h:697
This structure is common to all GPIO drivers and is expected to be the first element in the driver's ...
Definition gpio.h:704
gpio_port_pins_t invert
Mask identifying pins that are configured as active low.
Definition gpio.h:710
Container for GPIO pin information specified in devicetree.
Definition gpio.h:289
const struct device * port
GPIO device controlling the pin.
Definition gpio.h:291
gpio_pin_t pin
The pin's number on the device.
Definition gpio.h:293
gpio_dt_flags_t dt_flags
The pin's configuration flags as specified in devicetree.
Definition gpio.h:295