
GD32L23x User Manual
458
The UESM bit must be set and the LPUART clock must be set to IRC16M or LXTAL (refer to
the reset and clock unit RCU section). When the LPUART clock source is configured to be
IRC16M
or LXTAL, it is possible to keep enabled this clock during Deep-sleep mode by setting
the UCESM bit in LPUART_CTL2 register.
When using the standard RBNE interrupt, the RBNEIE bit must be set before entering Deep-
sleep mode.
When using the WUIE interrupt, the source of WUIE interrupt may be selected through the
WUM bit fields.
DMA must be disabled before entering Deep-sleep mode. Before entering Deep-sleep mode,
software must check that the LPUART is not performing a transfer, by checking the BSY flag
in the LPUART_STAT register. The REA bit must be checked to ensure the LPUART is
actually enabled.
When the wakeup event is detected, the WUF flag is set by hardware and a wakeup interrupt
is generated if the WUIE bit is set, independently of whether the MCU is in stop or active
mode.
20.3.10.
LPUART interrupts
The LPUART interrupt events and flags are listed in
Table 20-3. LPUART interrupt requests
Table 20-3. LPUART interrupt requests
Interrupt event
Event flag
Enable Control bit
Transmit data register empty
TBE
TBEIE
CTS flag
CTSF
CTSIE
Transmission complete
TC
TCIE
Received data ready to be
read
RBNE
RBNEIE
Overrun error detected
ORERR
Idle line detected
IDLEF
IDLEIE
Parity error flag
PERR
PERRIE
Reception Errors (Noise flag,
overrun error, framing error)
NERR or ORERR or FERR
ERRIE
Character match
AMF
AMIE
Wakeup from Deep-sleep
mode
WUF
WUIE
All of the interrupt events are ORed together before being sent to the interrupt controller, so
the LPUART can only generate a single interrupt request to the controller at any given time.
Software can service multiple interrupt events in a single interrupt service routine