|
Extend
EDMA capability on C 671x DSPs
C6x1x DSPs
offer EDMA (Enhanced Direct Memory Access) for highly configurable
data transfers. Two of the important features that EDMA offers are
Linking and Chaining the data transfers. Linking EDMA channels is a
characteristic that allows the application developer to reload the
channel configuration parameters for the next transfer. Linking does
not trigger the next transfer; it only reloads the new
configuration. Chaining EDMA channels is a characteristic that
allows the application developer to configure two channels such that
the transfer completion event of one channel triggers another
channel transfer.
Only 4
channels (channel nos. 8,9,10 & 11) out of total 16 EDMA
channels on the C671x DSPs are chainable. This can be a limitation
in a system where automatic triggering of multiple data transfers is
needed in a sequence.
Consider that
4 EDMA transfers need to be triggered by a single call. Using 4 EDMA
channels out of which 3 are chainable, as shown in the figure below
can do this:
Chan2
chained to Chan1,
Chan3 chained to Chan2, and
Chan4 chained to Chan3,
However, using
only 2 chainable EDMA channels and one PaRAM table entry, as shown
in the figure and the accompanying code below can also do this:
Chan2
is chained to Chan1,
Chan3 chained to Chan2, Chan2 parameters gets reloaded with new
configuration parameters in the PaRAM table, and
Chan2 chained to Chan3,
// Allocate 2
Parameter RAM tables from the PRAM
EDMA_allocTableEx(2, hEdmaRld);
// Allocate
any EDMA channel. This channel will start the transfers
hChan1 = EDMA_open( EDMA_CHA_ANY, EDMA_OPEN_RESET);
// Allocate
the Transfer Complete Code for the Chainable EDMA channels
chan8Tcc = EDMA_intAlloc(8);
chan9Tcc = EDMA_intAlloc(9);
// Open the 2
Chainable EDMA channels
hChan2 = EDMA_open( chan8Tcc, EDMA_OPEN_RESET);
hChan3 = EDMA_open( chan9Tcc, EDMA_OPEN_RESET);
// Configure
all the 4 EDMA channels, the Cfgx structures are filled
already
EDMA_config( hChan1, &Cfg1);
EDMA_config( hChan2, &Cfg2);
EDMA_config( hChan3, &Cfg3);
EDMA_config( hEdmaRld[0], &Cfg4);
EDMA_config( hEdmaRld[1], &CfgNull);
// Setup the
links for reload tables
EDMA_link(hChan2, hEdmaRld[0]);
EDMA_link(hEdmaRld[0], hEdmaRld[1]);
// Chain the
EDMA channels
EDMA_chain(hChan1, hChan2, EDMA_TCC_SET, 0);
EDMA_chain(hChan2, hChan3, EDMA_TCC_SET, 0);
EDMA_chain(hChan3, hChan2, EDMA_TCC_SET, 0);
// Enable the
Chain the EDMA channels
EDMA_enableChaining(hChan2);
EDMA_enableChaining(hChan3);
// This
function will start the first EDMA transfer
EDMA_setChannel(hChan1);
|