GD32W51x User Manual
606
If the software read receive data buffer in the routing of the RBNE interrupt, the RBNEIE bit
should be reset at the beginning of the routing and set after all of the receive data is read out.
The PERR/NERR/FERR/EBF/ABDE/ABDF flags should be cleared before reading a receive
data out.
18.3.16.
Wakeup from Deep-sleep mode
The USART is able to wake up the MCU from Deep-sleep mode by the standard RBNE
interrupt or the WUM interrupt.
The UESM bit must be set and the USART clock must be set to IRC16M or LXTAL (refer to
the reset and clock unit RCU section).
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 USART is not performing a transfer, by checking the BSY flag
in the USART_STAT register. The REA bit must be checked to ensure the USART 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.
18.3.17.
USART interrupts
The USART interrupt events and flags are listed in
Table 18-3. USART interrupt requests
Table 18-3. USART 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
Receive FIFO full
RFFINT
RFFIE
Idle line detected
IDLEF
IDLEIE
Parity error flag
PERR
PERRIE
Break detected flag in LIN
mode
LBDF
LBDIE
Reception Errors (Noise flag,
NERR or ORERR or FERR
ERRIE