![GigaDevice Semiconductor GD32E23 Series Скачать руководство пользователя страница 436](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794436.webp)
GD32E23x User Manual
436
Figure 16-5. Configuration step when using DMA for USART transmission
Set the address of USART_TDATA
as the DMA destination address
Set the address of data in internal
sram as the DMA source address
Set the number of data as the DMA
transfer number
Set other configurations of DMA,
interrupt enable, priority, etc
Clear the TC bit in USART_STAT
Enable the DMA channel for USART
Wait the TC bit to be set
After all of the data frames are transmitted, the TC bit in USART_STAT is set. An interrupt
occurs if the TCIE bit in USART_CTL0 is set.
When DMA is used for USART reception, DMA transfers data from the receive data buffer of
the USART to the internal SRAM. The configuration steps are shown in
Configuration step when using DMA for USART reception
. If the ERRIE bit in
USART_CTL2 is set, interrupts can be generated by the error status bits (FERR, ORERR
and NERR) in USART_STAT.