diff options
Diffstat (limited to 'c/src/lib/libbsp/arm/atsam/libraries/libchip/include/pio_it.h')
-rw-r--r-- | c/src/lib/libbsp/arm/atsam/libraries/libchip/include/pio_it.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/c/src/lib/libbsp/arm/atsam/libraries/libchip/include/pio_it.h b/c/src/lib/libbsp/arm/atsam/libraries/libchip/include/pio_it.h index 4235ec9bde..b03973caa1 100644 --- a/c/src/lib/libbsp/arm/atsam/libraries/libchip/include/pio_it.h +++ b/c/src/lib/libbsp/arm/atsam/libraries/libchip/include/pio_it.h @@ -77,11 +77,31 @@ extern "C" { extern void PIO_InitializeInterrupts(uint32_t dwPriority); -extern void PIO_ConfigureIt(const Pin *pPin, void (*handler)(const Pin *)); +extern void PIO_ConfigureIt(const Pin *pPin, + void (*handler)(const Pin *, void *arg), void *arg); -extern void PIO_EnableIt(const Pin *pPin); -extern void PIO_DisableIt(const Pin *pPin); +/** + * Enables the given interrupt source if it has been configured. The status + * register of the corresponding PIO controller is cleared prior to enabling + * the interrupt. + * \param pPin Interrupt source to enable. + */ +static inline void PIO_EnableIt(const Pin *pPin) +{ + pPin->pio->PIO_ISR; + pPin->pio->PIO_IER = pPin->mask; +} + +/** + * Disables a given interrupt source, with no added side effects. + * + * \param pPin Interrupt source to disable. + */ +static inline void PIO_DisableIt(const Pin *pPin) +{ + pPin->pio->PIO_IDR = pPin->mask; +} extern void PIO_IT_InterruptHandler(void); |