GD32W51x User Manual
221
event to the processer. The EXTI has three trigger types: rising edge, falling edge and both
edges. Each edge detector in the EXTI can be configured and masked independently.
The EXTI trigger source includes
16
external lines from GPIO pins and
13
lines from internal
modules (
including LVD, RTC, USART, USBFS, I2C and Wi-Fi
)
.
All GPIO pins can be selected
as an EXTI trigger source by configuring SYSCFG_EXTISSx registers in SYSCFG module
(please refer to
System configuration controller (SYSCFG)
section for detail).
EXTI can provide not only interrupts but also event signals to the processor. The Cortex-M33
processor fully implements the Wait For Interrupt (WFI), Wait For Event (WFE) and the Send
Event (SEV) instructions. The Wake-up Interrupt Controller (WIC) enables the processor and
NVIC to be put into a very low-power sleep mode leaving the WIC to identify and prioritize
interrupts and event. EXTI can be used to wake up processor and the whole system when
some expected event occurs, such as a special GPIO pin toggling or RTC alarm.
The internal trigger source from USART is able to generate event for waking up the system.
However, the module is also requested to generate a synchronous interrupt for the processor
to wake up the CPU from Deep-sleep mode. Both internal trigger lines can be masked by
setting corresponding INTEN and EVEN registers in EXTI module.
Hardware Trigger
Hardware trigger may be used to detect the voltage change of external or internal signals.
The software should follow these steps to use this function:
1. Configure EXTI sources in SYSCFG module based on application requirement.
2. Configure EXTI_RTEN and EXTI_FTEN to enable the rising or falling detection on
related pins. (Software may set both RTENx and FTENx for a pin at the same time to detect
both rising and falling changes on this pin).
3. Enable interrupts or events by setting related EXTI_INTEN or EXTI_EVEN bits.
4. EXTI starts to detect changes on the configured pins. The related PDx bits in EXTI_PD
will be set when desired change is detected on these pins and thus, trigger interrupt or event
for software. The software should response to the interrupts or events and clear these PDx
bits.
Software Trigger
Software may also trigger EXTI interrupts or events following these steps:
1. Enable interrupts or events by setting related EXTI_INTEN or EXTI_EVEN bits.
2. Set SWIEVx bits in EXTI_SWIEV register. The related PDx bits will be set immediately
and thus, trigger interrupts or events. Software should response to these interrupts, and clear
related PDx bits.
Table 7-3. EXTI source
EXTI Line
Num ber
Source
0
PA0 / PB0 / PC0