Product Specs

Table Of Contents
10 EasyDMA
Page
28
#define BUFFER_SIZE 4
typedef struct ArrayList
{
uint8_t buffer[BUFFER_SIZE];
} ArrayList_type;
ArrayList_type ReaderList[3];
READER.MAXCNT = BUFFER_SIZE;
READER.PTR = &ReaderList;
0x20000000
0x20000004
0x20000008
Figure 7: EasyDMA memory layout
The EasyDMA channel's MAXCNT register cannot be specified larger than the actual size of the buffer. If,
for example, the WRITER.MAXCNT register is specified larger than the size of the writerBuffer, the WRITER
EasyDMA channel may overflow the writerBuffer.
After the peripheral has completed the EasyDMA transfer, the CPU can read the EasyDMA channel's
AMOUNT register to see how many bytes that were transferred, e.g. it is possible for the CPU to read the
MYPERIPHERAL->WRITER.AMOUNT register to see how many bytes the WRITER wrote to RAM.
10.1 EasyDMA array list
The EasyDMA is able to operate in a mode called array list.
The EasyDMA array list can be represented by the data structure ArrayList_type illustrated in the code
example below.
This data structure includes only a buffer with size equal to READER.MAXCNT. EasyDMA will use the
READER.MAXCNT register to determine when the buffer is full.
This array list does not provide a mechanism to explicitly specify where the next item in the list is located.
Instead, it assumes that the list is organized as a linear array where items are located one after the other in
RAM.
READER.PTR = &ReaderList
0x20000000 : ReaderList[0]
0x20000004 : ReaderList[1]
0x20000008 : ReaderList[2]
Figure 8: EasyDMA array list
readerBuffer[0]
readerBuffer[1]
readerBuffer[2]
readerBuffer[3]
readerBuffer[4]
writerBuffer[0]
writerBuffer[1]
writerBuffer[2]
writerBuffer[3]
writerBuffer[4]
writerBuffer[5]
buffer[0]
buffer[1]
buffer[2]
buffer[3]
buffer[0]
buffer[1]
buffer[2]
buffer[3]
buffer[0]
buffer[1]
buffer[2]
buffer[3]