![ARTERY AT32F435 Series Скачать руководство пользователя страница 150](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592150.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 150
Rev 2.03
9.3 Function overview
9.3.1
DMA configuration
1. Set the peripheral address in the DMA_CxPADDR register
The initial peripheral address for data transfer remains unchanged during transmission.
2. Set the memory address in the DMA_CxMADDR register
The initial memory address for data transfer remains unchanged during transmission.
3. Configure the amount of data to be transferred in the DMA_CxDTCNT register
Programmable data transfer size is up to 65535. This value is decremented after each data transfer.
4. Configure the channel setting in the DMA_CxCTRL register
Including channel priority, data transfer direction/width, address incremented mode, circular mode
and interrupt mode
Channel priority (CHPL)
There are four levels, including very high priority, high priority, medium priority and low priority.
If the two channels have the same priority level, then the channel with lower number will get priority
over the one with higher number. For example, channel 1 has priority over channel 2.
Data transfer direction (DTD)
Memory-to-peripheral (M2P), peripheral-to-memory (P2M)
Address incremented mode (PINCM/MINCM)
In incremented mode, the subsequent transfer address is the previous address plus transfer width
(PWIDTH/MWIDTH).
Circular mode (LM)
In circular mode, the contents in the DMA_CxDTCNT register is automatically reloaded with the
initially programmed value after the completion of the last transfer.
Memory-to-memory mode (M2M)
This mode indicates that DMA channels perform data transfer without requests from peripherals.
Circular mode and memory-to-memory mode cannot be used at the same time.
5.
Enable DMA transfer by setting the CHEN bit in the DMA_CxCTRL register
9.3.2
Handshake mechanism
In P2M and M2P mode, the peripherals need to send a request signal to the DMA controller. The DMA
channel will send the peripheral transfer request (single) until the signal is acknowledged. After the
completion of peripheral transmission, the DMA controller sends the acknowledge signal to the
peripheral. The peripheral then releases its request as soon as it receives the acknowledge signal. At
the same time, the DMA controller releases the acknowledge signal as well.