File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
src/rp2_common/hardware_gpio Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,10 @@ void gpio_init(uint gpio) {
217217 gpio_set_function (gpio , GPIO_FUNC_SIO );
218218}
219219
220+ void gpio_deinit (uint gpio ) {
221+ gpio_set_function (gpio , GPIO_FUNC_NULL );
222+ }
223+
220224void gpio_init_mask (uint gpio_mask ) {
221225 for (uint i = 0 ;i < 32 ;i ++ ) {
222226 if (gpio_mask & 1 ) {
Original file line number Diff line number Diff line change @@ -414,6 +414,13 @@ void gpio_acknowledge_irq(uint gpio, uint32_t events);
414414 */
415415void gpio_init (uint gpio);
416416
417+ /* ! \brief Resets a GPIO back to the NULL function, i.e. disables it.
418+ * \ingroup hardware_gpio
419+ *
420+ * \param gpio GPIO number
421+ */
422+ void gpio_deinit (uint gpio);
423+
417424/* ! \brief Initialise multiple GPIOs (enabled I/O and set func to GPIO_FUNC_SIO)
418425 * \ingroup hardware_gpio
419426 *
You can’t perform that action at this time.
0 commit comments