![Maxim Integrated MAX32660 Скачать руководство пользователя страница 62](http://html1.mh-extra.com/html/maxim-integrated/max32660/max32660_user-manual_1744484062.webp)
MAX32660 User Guide
Maxim Integrated
Page 62 of 195
enabled for any number of GPIO on each GPIO port. The following procedure details the steps for enabling Active mode
interrupt events for a GPIO pin:
1.
Disable interrupts by setting the
[pin]
field to 0. This will prevent any new interrupts on the pin
from triggering but will not clear previously triggered (pending) interrupts. The application can disable all
interrupts for GPIO by writing 0 to
[13:0]
. To maintain previously enabled interrupts, read the
register and save the value to memory prior to setting the register to 0.
2.
Clear pending interrupts by writing 1 to the
[pin]
bit.
3.
Set
[pin]
to select either level (0) or edge triggered (1) interrupts.
a.
For level triggered interrupts, the interrupt triggers on an input high or low.
i.
[pin]
= 1: Input high triggers interrupt.
ii.
[pin]
= 0: Input low triggers interrupt.
b.
For edge triggered interrupts, the interrupt triggers on an edge event.
i.
[pin]
= 0: Input rising edge triggers interrupt.
ii.
[pin]
= 1: Input falling edge triggers interrupt.
c.
Optionally set
[pin]
to 1 to trigger on both the rising and falling edges of the input
signal.
4.
Set
[pin]
to 1 to enable the interrupt for the pin.
6.4.1
Interrupts
The GPIO pins generate interrupts if the pin is configured for I/O mode and the interrupt is enabled for the pin
(
[pin]
for details on configuring a pin for I/O mode.
Table 6-6: GPIO Port Interrupt Vector Mapping
GPIO Interrupt Source
GPIO Interrupt Flag
Register
Device Specific Interrupt
Vector Number
GPIO Interrupt Vector
GPIO0[13:0]
GPIO0_INT_FL
40
GPIO0_IRQHandler
To handle GPIO interrupts in your interrupt vector handler, complete the following steps:
1.
Read the
register to determine the GPIO pin that triggered the interrupt. The bit position that reads
1 indicates the pin that resulted in the interrupt event. If multiple bits are set, each of them indicates an interrupt
event occurred on the respective pin.
2.
Complete interrupt tasks associated with the interrupt source pin (application defined).
3.
Clear the interrupt flag in the
register by writing 1 to the
the interrupt. This also clears and rearms the edge detectors for edge triggered interrupts.
4.
Return from the interrupt vector handler.
6.4.2
Using GPIO for Wakeup from Low Power Modes
Low power modes support wakeup from external edge triggered interrupts on the GPIO ports. Level triggered interrupts are
not supported for wakeup because the system clock must be active to detect levels.
For wake-up interrupts on the GPIO a single interrupt vector, GPIOWAKE_IRQHandler, is assigned for all the GPIO pins.
When the wakeup event occurs, the application software must interrogate the
register to determine which
external pin caused the wake-up event.
Table 6-7: GPIO Wakeup Interrupt Vector
GPIO Wake Interrupt
Source
GPIO Wake Interrupt
Status Register
Device Specific Interrupt
Vector Number
GPIO Wakeup
Interrupt Vector
GPIO0[0:13]
GPIO0_INT_FL
70
GPIOWAKE_IRQHandler
Содержание MAX32660
Страница 4: ...MAX32660 User Guide Maxim Integrated Page 4 of 195 8 UART 84 9 Real Time Clock RTC 96 10 Timers 105...
Страница 7: ...MAX32660 User Guide Maxim Integrated Page 7 of 195 15 Trademarks 195 16 Revision History 195...
Страница 14: ...MAX32660 User Guide Maxim Integrated Page 14 of 195 Figure 2 1 MAX32660 High Level Block Diagram...