15#ifndef ZEPHYR_INCLUDE_DRIVERS_GPIO_H_
16#define ZEPHYR_INCLUDE_DRIVERS_GPIO_H_
47#define GPIO_INPUT (1U << 16)
50#define GPIO_OUTPUT (1U << 17)
53#define GPIO_DISCONNECTED 0
58#define GPIO_OUTPUT_INIT_LOW (1U << 18)
61#define GPIO_OUTPUT_INIT_HIGH (1U << 19)
64#define GPIO_OUTPUT_INIT_LOGICAL (1U << 20)
69#define GPIO_OUTPUT_LOW (GPIO_OUTPUT | GPIO_OUTPUT_INIT_LOW)
71#define GPIO_OUTPUT_HIGH (GPIO_OUTPUT | GPIO_OUTPUT_INIT_HIGH)
73#define GPIO_OUTPUT_INACTIVE (GPIO_OUTPUT | \
74 GPIO_OUTPUT_INIT_LOW | \
75 GPIO_OUTPUT_INIT_LOGICAL)
77#define GPIO_OUTPUT_ACTIVE (GPIO_OUTPUT | \
78 GPIO_OUTPUT_INIT_HIGH | \
79 GPIO_OUTPUT_INIT_LOGICAL)
100#define GPIO_INT_DISABLE (1U << 21)
105#define GPIO_INT_ENABLE (1U << 22)
112#define GPIO_INT_LEVELS_LOGICAL (1U << 23)
121#define GPIO_INT_EDGE (1U << 24)
129#define GPIO_INT_LOW_0 (1U << 25)
137#define GPIO_INT_HIGH_1 (1U << 26)
139#ifdef CONFIG_GPIO_ENABLE_DISABLE_INTERRUPT
146#define GPIO_INT_ENABLE_DISABLE_ONLY (1u << 27)
149#define GPIO_INT_MASK (GPIO_INT_DISABLE | \
151 GPIO_INT_LEVELS_LOGICAL | \
160#define GPIO_INT_EDGE_RISING (GPIO_INT_ENABLE | \
167#define GPIO_INT_EDGE_FALLING (GPIO_INT_ENABLE | \
174#define GPIO_INT_EDGE_BOTH (GPIO_INT_ENABLE | \
182#define GPIO_INT_LEVEL_LOW (GPIO_INT_ENABLE | \
188#define GPIO_INT_LEVEL_HIGH (GPIO_INT_ENABLE | \
194#define GPIO_INT_EDGE_TO_INACTIVE (GPIO_INT_ENABLE | \
195 GPIO_INT_LEVELS_LOGICAL | \
202#define GPIO_INT_EDGE_TO_ACTIVE (GPIO_INT_ENABLE | \
203 GPIO_INT_LEVELS_LOGICAL | \
210#define GPIO_INT_LEVEL_INACTIVE (GPIO_INT_ENABLE | \
211 GPIO_INT_LEVELS_LOGICAL | \
217#define GPIO_INT_LEVEL_ACTIVE (GPIO_INT_ENABLE | \
218 GPIO_INT_LEVELS_LOGICAL | \
224#define GPIO_DIR_MASK (GPIO_INPUT | GPIO_OUTPUT)
331#define GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, idx) \
333 .port = DEVICE_DT_GET(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx)),\
334 .pin = DT_GPIO_PIN_BY_IDX(node_id, prop, idx), \
335 .dt_flags = DT_GPIO_FLAGS_BY_IDX(node_id, prop, idx), \
355#define GPIO_DT_SPEC_GET_BY_IDX_OR(node_id, prop, idx, default_value) \
356 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
357 (GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, idx)), \
368#define GPIO_DT_SPEC_GET(node_id, prop) \
369 GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, 0)
381#define GPIO_DT_SPEC_GET_OR(node_id, prop, default_value) \
382 GPIO_DT_SPEC_GET_BY_IDX_OR(node_id, prop, 0, default_value)
394#define GPIO_DT_SPEC_INST_GET_BY_IDX(inst, prop, idx) \
395 GPIO_DT_SPEC_GET_BY_IDX(DT_DRV_INST(inst), prop, idx)
408#define GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, prop, idx, default_value) \
409 COND_CODE_1(DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx), \
410 (GPIO_DT_SPEC_GET_BY_IDX(DT_DRV_INST(inst), prop, idx)), \
421#define GPIO_DT_SPEC_INST_GET(inst, prop) \
422 GPIO_DT_SPEC_INST_GET_BY_IDX(inst, prop, 0)
434#define GPIO_DT_SPEC_INST_GET_OR(inst, prop, default_value) \
435 GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, prop, 0, default_value)
451#define Z_GPIO_GEN_BITMASK_COND(node_id, prop, off_idx, sz_idx) \
452 COND_CODE_1(DT_PROP_HAS_IDX(node_id, prop, off_idx), \
453 (COND_CODE_0(DT_PROP_BY_IDX(node_id, prop, sz_idx), \
455 (GENMASK64(DT_PROP_BY_IDX(node_id, prop, off_idx) + \
456 DT_PROP_BY_IDX(node_id, prop, sz_idx) - 1, \
457 DT_PROP_BY_IDX(node_id, prop, off_idx)))) \
467#define Z_GPIO_GEN_RESERVED_RANGES_COND(odd_it, node_id) \
468 COND_CODE_1(DT_PROP_HAS_IDX(node_id, gpio_reserved_ranges, odd_it), \
469 (Z_GPIO_GEN_BITMASK_COND(node_id, \
470 gpio_reserved_ranges, \
471 GET_ARG_N(odd_it, Z_SPARSE_LIST_EVEN_NUMBERS), \
566#define GPIO_DT_RESERVED_RANGES_NGPIOS(node_id, ngpios) \
567 ((gpio_port_pins_t) \
568 COND_CODE_1(DT_NODE_HAS_PROP(node_id, gpio_reserved_ranges), \
569 (GENMASK64(BITS_PER_LONG_LONG - 1, ngpios) \
570 | FOR_EACH_FIXED_ARG(Z_GPIO_GEN_RESERVED_RANGES_COND, \
573 LIST_DROP_EMPTY(Z_SPARSE_LIST_ODD_NUMBERS))), \
583#define GPIO_DT_RESERVED_RANGES(node_id) \
584 GPIO_DT_RESERVED_RANGES_NGPIOS(node_id, DT_PROP(node_id, ngpios))
595#define GPIO_DT_INST_RESERVED_RANGES_NGPIOS(inst, ngpios) \
596 GPIO_DT_RESERVED_RANGES_NGPIOS(DT_DRV_INST(inst), ngpios)
606#define GPIO_DT_INST_RESERVED_RANGES(inst) \
607 GPIO_DT_RESERVED_RANGES(DT_DRV_INST(inst))
657#define GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(node_id, ngpios) \
658 ((gpio_port_pins_t) \
659 COND_CODE_0(ngpios, \
661 (COND_CODE_1(DT_NODE_HAS_PROP(node_id, gpio_reserved_ranges), \
662 ((GENMASK64(ngpios - 1, 0) & \
663 ~GPIO_DT_RESERVED_RANGES_NGPIOS(node_id, ngpios))), \
664 (GENMASK64(ngpios - 1, 0))) \
677#define GPIO_DT_INST_PORT_PIN_MASK_NGPIOS_EXC(inst, ngpios) \
678 GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(DT_DRV_INST(inst), ngpios)
683#define GPIO_MAX_PINS_PER_PORT (sizeof(gpio_port_pins_t) * __CHAR_BIT__)
770 GPIO_INT_MODE_LEVEL = GPIO_INT_ENABLE,
771 GPIO_INT_MODE_EDGE = GPIO_INT_ENABLE | GPIO_INT_EDGE,
772#ifdef CONFIG_GPIO_ENABLE_DISABLE_INTERRUPT
773 GPIO_INT_MODE_DISABLE_ONLY =
GPIO_INT_DISABLE | GPIO_INT_ENABLE_DISABLE_ONLY,
774 GPIO_INT_MODE_ENABLE_ONLY = GPIO_INT_ENABLE | GPIO_INT_ENABLE_DISABLE_ONLY,
782 GPIO_INT_TRIG_LOW = GPIO_INT_LOW_0,
785 GPIO_INT_TRIG_HIGH = GPIO_INT_HIGH_1,
787 GPIO_INT_TRIG_BOTH = GPIO_INT_LOW_0 | GPIO_INT_HIGH_1,
792__subsystem
struct gpio_driver_api {
795#ifdef CONFIG_GPIO_GET_CONFIG
799 int (*port_get_raw)(
const struct device *port,
801 int (*port_set_masked_raw)(
const struct device *port,
804 int (*port_set_bits_raw)(
const struct device *port,
806 int (*port_clear_bits_raw)(
const struct device *port,
808 int (*port_toggle_bits)(
const struct device *port,
810 int (*pin_interrupt_configure)(
const struct device *port,
812 enum gpio_int_mode,
enum gpio_int_trig);
813 int (*manage_callback)(
const struct device *port,
817#ifdef CONFIG_GPIO_GET_DIRECTION
866static inline int z_impl_gpio_pin_interrupt_configure(
const struct device *port,
870 const struct gpio_driver_api *api =
871 (
const struct gpio_driver_api *)port->
api;
876 enum gpio_int_trig trig;
877 enum gpio_int_mode mode;
879 if (api->pin_interrupt_configure == NULL) {
885 "Cannot both enable and disable interrupts");
888 "Must either enable or disable interrupts");
890 __ASSERT(((
flags & GPIO_INT_ENABLE) == 0) ||
891 ((
flags & GPIO_INT_EDGE) != 0) ||
892 ((
flags & (GPIO_INT_LOW_0 | GPIO_INT_HIGH_1)) !=
893 (GPIO_INT_LOW_0 | GPIO_INT_HIGH_1)),
894 "Only one of GPIO_INT_LOW_0, GPIO_INT_HIGH_1 can be "
895 "enabled for a level interrupt.");
897 __ASSERT(((
flags & GPIO_INT_ENABLE) == 0) ||
898#ifdef CONFIG_GPIO_ENABLE_DISABLE_INTERRUPT
899 ((
flags & (GPIO_INT_LOW_0 | GPIO_INT_HIGH_1)) != 0) ||
900 (
flags & GPIO_INT_ENABLE_DISABLE_ONLY) != 0,
902 ((
flags & (GPIO_INT_LOW_0 | GPIO_INT_HIGH_1)) != 0),
904 "At least one of GPIO_INT_LOW_0, GPIO_INT_HIGH_1 has to be "
910 if (((
flags & GPIO_INT_LEVELS_LOGICAL) != 0) &&
913 flags ^= (GPIO_INT_LOW_0 | GPIO_INT_HIGH_1);
917#ifdef CONFIG_GPIO_ENABLE_DISABLE_INTERRUPT
919 GPIO_INT_ENABLE_DISABLE_ONLY));
924 return api->pin_interrupt_configure(port, pin, mode, trig);
965static inline int z_impl_gpio_pin_configure(
const struct device *port,
969 const struct gpio_driver_api *api =
970 (
const struct gpio_driver_api *)port->
api;
976 __ASSERT((
flags & GPIO_INT_MASK) == 0,
977 "Interrupt flags are not supported");
981 "Pull Up and Pull Down should not be enabled simultaneously");
984 "Input cannot be enabled for 'Open Drain', 'Open Source' modes without Output");
986 __ASSERT_NO_MSG((
flags & GPIO_SINGLE_ENDED) != 0 ||
987 (
flags & GPIO_LINE_OPEN_DRAIN) == 0);
989 __ASSERT((
flags & (GPIO_OUTPUT_INIT_LOW | GPIO_OUTPUT_INIT_HIGH)) == 0
991 "Output needs to be enabled to be initialized low or high");
993 __ASSERT((
flags & (GPIO_OUTPUT_INIT_LOW | GPIO_OUTPUT_INIT_HIGH))
994 != (GPIO_OUTPUT_INIT_LOW | GPIO_OUTPUT_INIT_HIGH),
995 "Output cannot be initialized low and high");
997 if (((
flags & GPIO_OUTPUT_INIT_LOGICAL) != 0)
998 && ((
flags & (GPIO_OUTPUT_INIT_LOW | GPIO_OUTPUT_INIT_HIGH)) != 0)
1000 flags ^= GPIO_OUTPUT_INIT_LOW | GPIO_OUTPUT_INIT_HIGH;
1003 flags &= ~GPIO_OUTPUT_INIT_LOGICAL;
1014 return api->pin_configure(port, pin,
flags);
1057#ifdef CONFIG_GPIO_GET_DIRECTION
1062 const struct gpio_driver_api *api = (
const struct gpio_driver_api *)port->
api;
1064 if (api->port_get_direction == NULL) {
1068 return api->port_get_direction(port, map, inputs, outputs);
1180#ifdef CONFIG_GPIO_GET_CONFIG
1181static inline int z_impl_gpio_pin_get_config(
const struct device *port,
1185 const struct gpio_driver_api *api =
1186 (
const struct gpio_driver_api *)port->
api;
1188 if (api->pin_get_config == NULL)
1191 return api->pin_get_config(port, pin,
flags);
1233static inline int z_impl_gpio_port_get_raw(
const struct device *port,
1236 const struct gpio_driver_api *api =
1237 (
const struct gpio_driver_api *)port->
api;
1239 return api->port_get_raw(port, value);
1296static inline int z_impl_gpio_port_set_masked_raw(
const struct device *port,
1300 const struct gpio_driver_api *api =
1301 (
const struct gpio_driver_api *)port->
api;
1303 return api->port_set_masked_raw(port, mask, value);
1351static inline int z_impl_gpio_port_set_bits_raw(
const struct device *port,
1354 const struct gpio_driver_api *api =
1355 (
const struct gpio_driver_api *)port->
api;
1357 return api->port_set_bits_raw(port, pins);
1389static inline int z_impl_gpio_port_clear_bits_raw(
const struct device *port,
1392 const struct gpio_driver_api *api =
1393 (
const struct gpio_driver_api *)port->
api;
1395 return api->port_clear_bits_raw(port, pins);
1427static inline int z_impl_gpio_port_toggle_bits(
const struct device *port,
1430 const struct gpio_driver_api *api =
1431 (
const struct gpio_driver_api *)port->
api;
1433 return api->port_toggle_bits(port, pins);
1451 __ASSERT((set_pins & clear_pins) == 0,
"Set and Clear pins overlap");
1471 __ASSERT((set_pins & clear_pins) == 0,
"Set and Clear pins overlap");
1628 value = (value != 0) ? 0 : 1;
1696 __ASSERT(callback,
"Callback pointer should not be NULL");
1697 __ASSERT(handler,
"Callback handler pointer should not be NULL");
1720 const struct gpio_driver_api *api =
1721 (
const struct gpio_driver_api *)port->
api;
1723 if (api->manage_callback == NULL) {
1727 return api->manage_callback(port, callback,
true);
1768 const struct gpio_driver_api *api =
1769 (
const struct gpio_driver_api *)port->
api;
1771 if (api->manage_callback == NULL) {
1775 return api->manage_callback(port, callback,
false);
1811static inline int z_impl_gpio_get_pending_int(
const struct device *dev)
1813 const struct gpio_driver_api *api =
1814 (
const struct gpio_driver_api *)dev->
api;
1816 if (api->get_pending_int == NULL) {
1820 return api->get_pending_int(dev);
1831#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:1717
#define GPIO_OUTPUT
Enables pin as output, no change to the output state.
Definition: gpio.h:50
static int gpio_pin_get_raw(const struct device *port, gpio_pin_t pin)
Get physical level of an input pin.
Definition: gpio.h:1491
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:1084
static int gpio_pin_get(const struct device *port, gpio_pin_t pin)
Get logical level of an input pin.
Definition: gpio.h:1528
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:1157
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:940
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:726
static int gpio_remove_callback_dt(const struct gpio_dt_spec *spec, struct gpio_callback *callback)
Remove an application callback.
Definition: gpio.h:1789
static int gpio_pin_toggle_dt(const struct gpio_dt_spec *spec)
Toggle pin level from a gpio_dt_spec.
Definition: gpio.h:1681
uint8_t gpio_pin_t
Provides a type to hold a GPIO pin index.
Definition: gpio.h:254
static int gpio_pin_is_output(const struct device *port, gpio_pin_t pin)
Check if pin is configured for output.
Definition: gpio.h:1129
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:1028
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:1645
static int gpio_add_callback_dt(const struct gpio_dt_spec *spec, struct gpio_callback *callback)
Add an application callback.
Definition: gpio.h:1741
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:1370
uint32_t gpio_flags_t
Provides a type to hold GPIO configuration flags.
Definition: gpio.h:274
#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:1447
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:1467
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:1692
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:1112
#define GPIO_INPUT
Enables pin as input.
Definition: gpio.h:47
uint32_t gpio_port_pins_t
Identifies a set of pins associated with a port.
Definition: gpio.h:233
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:1207
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:100
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:1556
static int gpio_pin_toggle(const struct device *port, gpio_pin_t pin)
Toggle pin level.
Definition: gpio.h:1660
static bool gpio_is_ready_dt(const struct gpio_dt_spec *spec)
Validate that GPIO port is ready.
Definition: gpio.h:835
uint32_t gpio_port_value_t
Provides values for a set of pins associated with a port.
Definition: gpio.h:246
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:1616
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:1408
static int gpio_remove_callback(const struct device *port, struct gpio_callback *callback)
Remove an application callback.
Definition: gpio.h:1765
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:1326
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:266
#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:1576
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:1260
int gpio_pin_configure(const struct device *port, gpio_pin_t pin, gpio_flags_t flags)
Configure a single pin.
struct _snode sys_snode_t
Single-linked list node structure.
Definition: slist.h:39
#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:403
void * data
Address of the device instance private data.
Definition: device.h:413
const void * api
Address of the API structure exposed by the device instance.
Definition: device.h:409
const void * config
Address of device instance config information.
Definition: device.h:407
GPIO callback structure.
Definition: gpio.h:740
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:744
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:755
gpio_callback_handler_t handler
Actual callback function being called when relevant.
Definition: gpio.h:747
This structure is common to all GPIO drivers and is expected to be the first element in the object po...
Definition: gpio.h:690
gpio_port_pins_t port_pin_mask
Mask identifying pins supported by the controller.
Definition: gpio.h:696
This structure is common to all GPIO drivers and is expected to be the first element in the driver's ...
Definition: gpio.h:703
gpio_port_pins_t invert
Mask identifying pins that are configured as active low.
Definition: gpio.h:709
Container for GPIO pin information specified in devicetree.
Definition: gpio.h:288
const struct device * port
GPIO device controlling the pin.
Definition: gpio.h:290
gpio_pin_t pin
The pin's number on the device.
Definition: gpio.h:292
gpio_dt_flags_t dt_flags
The pin's configuration flags as specified in devicetree.
Definition: gpio.h:294