Skip to content

Commit e612770

Browse files
authored
Documentation: Clarify GPIO interrupt behaviour (#814)
1 parent 39a14b2 commit e612770

File tree

1 file changed

+11
-8
lines changed
  • src/rp2_common/hardware_gpio/include/hardware

1 file changed

+11
-8
lines changed

src/rp2_common/hardware_gpio/include/hardware/gpio.h

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,14 @@ enum gpio_drive_strength gpio_get_drive_strength(uint gpio);
367367
* \param event_mask Which events will cause an interrupt
368368
* \param enabled Enable or disable flag
369369
*
370-
* Events is a bitmask of the following:
370+
* Events is a bitmask of the following \ref gpio_irq_level values:
371371
*
372-
* bit | interrupt
373-
* ----|----------
374-
* 0 | Low level
375-
* 1 | High level
376-
* 2 | Edge low
377-
* 3 | Edge high
372+
* bit | constant | interrupt
373+
* ----|----------------------------------------------------------
374+
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
375+
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
376+
* 2 | GPIO_IRQ_EDGE_FALL | On each transition from high to low
377+
* 3 | GPIO_IRQ_EDGE_RISE | On each transition from low to high
378378
*
379379
* which are specified in \ref gpio_irq_level
380380
*/
@@ -466,7 +466,7 @@ static inline uint32_t gpio_get_irq_event_mask(uint gpio) {
466466
return (*status_reg >> (4 * (gpio & 7u))) & 0xfu;
467467
}
468468

469-
/*! \brief Acknowledge a GPIO interrupt for the specified events
469+
/*! \brief Acknowledge a GPIO interrupt for the specified events on the calling core
470470
* \ingroup hardware_gpio
471471
*
472472
* \note This may be called with a mask of any of valid bits specified in \ref gpio_irq_level, however
@@ -476,6 +476,9 @@ static inline uint32_t gpio_get_irq_event_mask(uint gpio) {
476476
* the opposite level).
477477
*
478478
* \param gpio GPIO number
479+
* \param events Bitmask of events to clear. See \ref gpio_set_irq_enabled for details.
480+
*
481+
* \note For callbacks set with \ref gpio_set_irq_enabled_with_callback, or \ref gpio_set_irq_callback,this function is called automatically.
479482
* \param event_mask Bitmask of events to clear. See \ref gpio_irq_level for details.
480483
*/
481484
void gpio_acknowledge_irq(uint gpio, uint32_t event_mask);

0 commit comments

Comments
 (0)