ADSP-BF537 Blackfin Processor Hardware Reference
5-109
Direct Memory Access
_main:
p0.l = lo(MDMA_S0_CONFIG);
p0.h = hi(MDMA_S0_CONFIG);
call memdma_setup;
call memdma_wait;
_main.forever:
jump _main.forever;
_main.end:
The setup routine shown in
initializes either MDMA0 or
MDMA1 depending on whether the MMR address of
MDMA_S0_CONFIG
or
MDMA_S1_CONFIG
is passed in the
P0
register. Note that the source channel
is enabled before the destination channel. Also, it is common to synchro-
nize interrupts with the destination channel, because only those interrupts
indicate completion of both DMA read and write operations.
Listing 5-2. Two-Dimensional Memory DMA Setup Example
memdma_setup:
[--sp] = r7;
/* setup 1D source DMA for 16-bit transfers */
r7.l = lo(aSource);
r7.h = hi(aSource);
[p0 + MDMA_S0_START_ADDR - MDMA_S0_CONFIG] = r7;
r7.l = 2;
w[p0 + MDMA_S0_X_MODIFY - MDMA_S0_CONFIG] = r7;
r7.l = X * Y;
w[p0 + MDMA_S0_X_COUNT - MDMA_S0_CONFIG] = r7;
r7.l = WDSIZE_16 | DMAEN;
w[p0] = r7;
/* setup 2D destination DMA for 16-bit transfers */
r7.l = lo(aDestination);
r7.h = hi(aDestination);
[p0 + MDMA_D0_START_ADDR - MDMA_S0_CONFIG] = r7;
r7.l = 2*Y;
Summary of Contents for Blackfin ADSP-BF537
Page 42: ...Contents xlii ADSP BF537 Blackfin Processor Hardware Reference ...
Page 90: ...Development Tools 1 32 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 138: ...Programming Examples 4 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 340: ...SDC Programming Examples 6 84 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 606: ...Programming Examples 9 94 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 660: ...Programming Examples 10 54 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 720: ...Electrical Specifications 11 60 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 840: ...Programming Examples 13 42 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 876: ...Programming Examples 14 36 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 938: ...Programming Examples 15 62 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 958: ...Programming Examples 17 12 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 986: ...Programming Examples 18 28 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1162: ...G 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1218: ...Index I 56 ADSP BF537 Blackfin Processor Hardware Reference ...