File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
src/rp2_common/hardware_gpio Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -270,3 +270,11 @@ void gpio_init_mask(uint gpio_mask) {
270
270
}
271
271
}
272
272
273
+ void gpio_set_function_mask (uint gpio_mask , enum gpio_function fn ) {
274
+ for (uint i = 0 ; i < NUM_BANK0_GPIOS ; i ++ ) {
275
+ if (gpio_mask & 1 ) {
276
+ gpio_set_function (i , fn );
277
+ }
278
+ gpio_mask >>= 1 ;
279
+ }
280
+ }
Original file line number Diff line number Diff line change @@ -185,6 +185,15 @@ static inline void check_gpio_param(__unused uint gpio) {
185
185
*/
186
186
void gpio_set_function (uint gpio, enum gpio_function fn);
187
187
188
+ /* ! \brief Select the function for multiple GPIOs
189
+ * \ingroup hardware_gpio
190
+ *
191
+ * \sa gpio_set_function
192
+ * \param gpio_mask Mask with 1 bit per GPIO number to set the function for
193
+ * \param fn Which GPIO function select to use from list \ref gpio_function
194
+ */
195
+ void gpio_set_function_mask (uint gpio_mask, enum gpio_function fn);
196
+
188
197
/* ! \brief Determine current GPIO function
189
198
* \ingroup hardware_gpio
190
199
*
You can’t perform that action at this time.
0 commit comments