@@ -73,6 +73,23 @@ static inline int gpio_emul_input_set(const struct device *port, gpio_pin_t pin,
7373 return gpio_emul_input_set_masked (port , BIT (pin ), value ? BIT (pin ) : 0 );
7474}
7575
76+ /**
77+ * @brief Modify the value of one emulated GPIO input pin from a @p gpio_dt_spec
78+ *
79+ * This is equivalent to:
80+ *
81+ * gpio_emul_input_set(spec->port, spec->pin, value);
82+ *
83+ * @param spec The emulated GPIO specification from devicetree
84+ * @param value New values to assign to the pin
85+ *
86+ * @return a value from gpio_emul_input_set()
87+ */
88+ static inline int gpio_emul_input_set_dt (const struct gpio_dt_spec * spec , int value )
89+ {
90+ return gpio_emul_input_set (spec -> port , spec -> pin , value );
91+ }
92+
7693/**
7794 * @brief Read the value of one or more emulated GPIO output @p pins
7895 *
@@ -108,6 +125,22 @@ static inline int gpio_emul_output_get(const struct device *port, gpio_pin_t pin
108125 return ret ;
109126}
110127
128+ /**
129+ * @brief Read the value of one emulated GPIO output pin from a @p gpio_dt_spec
130+ *
131+ * This is equivalent to:
132+ *
133+ * gpio_emul_output_get(spec->port, spec->pin);
134+ *
135+ * @param spec The emulated GPIO specification from devicetree
136+ *
137+ * @return a value from gpio_emul_output_get()
138+ */
139+ static inline int gpio_emul_output_get_dt (const struct gpio_dt_spec * spec )
140+ {
141+ return gpio_emul_output_get (spec -> port , spec -> pin );
142+ }
143+
111144/**
112145 * @brief Get @p flags for a given emulated GPIO @p pin
113146 *
@@ -122,6 +155,25 @@ static inline int gpio_emul_output_get(const struct device *port, gpio_pin_t pin
122155 */
123156int gpio_emul_flags_get (const struct device * port , gpio_pin_t pin , gpio_flags_t * flags );
124157
158+ /**
159+ * @brief Get @p flags for a given emulated GPIO pin from a @p gpio_dt_spec
160+ *
161+ * This is equivalent to:
162+ *
163+ * gpio_emul_flags_get(spec->port, spec->pin, flags);
164+ *
165+ * For more information on available flags, see @ref gpio_interface.
166+ *
167+ * @param spec The emulated GPIO specification from devicetree
168+ * @param flags a pointer to where the flags for the pin will be stored
169+ *
170+ * @return a value from gpio_emul_flags_get()
171+ */
172+ static inline int gpio_emul_flags_get_dt (const struct gpio_dt_spec * spec , gpio_flags_t * flags )
173+ {
174+ return gpio_emul_flags_get (spec -> port , spec -> pin , flags );
175+ }
176+
125177/**
126178 * @}
127179 */
0 commit comments