Skip to content
Snippets Groups Projects
Unverified Commit 7c5b426a authored by George Peppard's avatar George Peppard Committed by GitHub
Browse files

Add gpio_set_function_mask function (#1462)

parent af9b47c6
No related branches found
No related tags found
No related merge requests found
......@@ -270,3 +270,11 @@ void gpio_init_mask(uint gpio_mask) {
}
}
void gpio_set_function_mask(uint gpio_mask, enum gpio_function fn) {
for (uint i = 0; i < NUM_BANK0_GPIOS; i++) {
if (gpio_mask & 1) {
gpio_set_function(i, fn);
}
gpio_mask >>= 1;
}
}
......@@ -185,6 +185,15 @@ static inline void check_gpio_param(__unused uint gpio) {
*/
void gpio_set_function(uint gpio, enum gpio_function fn);
/*! \brief Select the function for multiple GPIOs
* \ingroup hardware_gpio
*
* \sa gpio_set_function
* \param gpio_mask Mask with 1 bit per GPIO number to set the function for
* \param fn Which GPIO function select to use from list \ref gpio_function
*/
void gpio_set_function_mask(uint gpio_mask, enum gpio_function fn);
/*! \brief Determine current GPIO function
* \ingroup hardware_gpio
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment