@@ -73,6 +73,23 @@ static inline int gpio_emul_input_set(const struct device *port, gpio_pin_t pin,
73
73
return gpio_emul_input_set_masked (port , BIT (pin ), value ? BIT (pin ) : 0 );
74
74
}
75
75
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
+
76
93
/**
77
94
* @brief Read the value of one or more emulated GPIO output @p pins
78
95
*
@@ -108,6 +125,22 @@ static inline int gpio_emul_output_get(const struct device *port, gpio_pin_t pin
108
125
return ret ;
109
126
}
110
127
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
+
111
144
/**
112
145
* @brief Get @p flags for a given emulated GPIO @p pin
113
146
*
@@ -122,6 +155,25 @@ static inline int gpio_emul_output_get(const struct device *port, gpio_pin_t pin
122
155
*/
123
156
int gpio_emul_flags_get (const struct device * port , gpio_pin_t pin , gpio_flags_t * flags );
124
157
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
+
125
177
/**
126
178
* @}
127
179
*/
0 commit comments