Single Descriptor Looped Transfer - Silicon Laboratories EFR32xG14 Wireless Gecko Reference Manual

Table of Contents

Advertisement

8.4.3 Single Descriptor Looped Transfer

This example demonstrates how to use looping using a single descriptor. This method allows a single DMA transfer to be repeated a
specified number of times. The looping descriptor is stored in memory and reloaded by hardware. After a specified number of iterations,
the transfer stops.
CH0 is setup to copy 4 words from the ADC FIFO into a 15 word buffer at 0x1000. It repeats 4 times to fill the entire 16 word buffer. An
interrupt will fire when the entire 16 words have been transfered.
Initialize the Linked descriptor in memory as follows:
• Configure CTRL member
• DSTMODE = 0 (absolute)
• SRCMODE = 0 (absolute)
• SIZE = WORD
• DSTINC = 0 (1 WORD)
• SRCINC = 3 (0 WORDS)
• DECLOOPCNT=1 (decrement loop count)
• REQMODE=1 (Use XFERCNT)
• BLOCKSIZE = 4 (4 words)
• BYTESWAP=0 (no swap)
• XFERCNT= 4 (4 words)
• STRUCTTPYE=0 (TRANSFER)
• IGNORESREQ=1 (ignore single requests)
• Write the address ADC0_SINGLEDATA register to the SRC member
• Write 0x1000 address to DST member
• Configure the LINKLink member
• LINK = 0 (stop after loop)
• MODE = 1 (relative link address)
• LINKADDR = 0 (point to ourself)
• Configure the Channel
• Write the desired number of repeats to the LDMA_CH0_LOOP register
• SOURCESEL in LDMA_CH0REQSEL = ADC0 (select the ADC)
• SIG in LDMA_CH0REQSEL = ADC0SCAN (select the scan conversion request)
• Clear and enable interrupts
• Load the descriptor using LINKLOAD as described in
Note that the looping descriptor must be stored in memory, because it must load itself from the link address in memory on each itera-
tion.
silabs.com | Building a more connected world.
8.4.2 Descriptor Linked List
A
LINKADDR->A
DECLOOPCNT=1
LINK=0
Figure 8.6. Single Descriptor Looped Transfer
Memory
Ctrl
0x00
Src
Dst
link_addr->A
Link
Reference Manual
LDMA - Linked DMA Controller
A
Rev. 1.1 | 171

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the EFR32xG14 Wireless Gecko and is the answer not in the manual?

Questions and answers

Table of Contents