1.9.4.19 DMA_ChannelLinkedListTransfer Function

C

bool DMA_ChannelLinkedListTransfer (DMA_CHANNEL channel, DMA_DESCRIPTOR_REGS* channelDesc)

Summary

The function submits a list of DMA transfers.

Description

The function will submit a list of DMA transfers. The DMA channel will process all transfers in the list. The transfers will be processed in the order in which they are added to the list. Each transfer in the list is specified by a DMA_DESCRIPTOR_REGS type descriptor. The list is formed by linking of the descriptors. While processing each descriptor in the linked list, the DMA transfer settings will be updated based on the settings contained in the descriptor.

It is possible to link the last descriptor in the list to the first descriptor. This results in transfer sequence without disruption. Such type of circular linked descriptor list are useful in audio applications.

The application must submit the entire list while calling the function.

When already a transfer is in progress, this API will return false indicating that transfer request is not accepted.

Precondition

DMA should have been initialized by calling DMA_Initialize. The Transfer Linked Option in MHC should have been enabled.

Parameters

Param Description
channel The DMA channel on which the transfer needs to scheduled.
channelDesc A pointer to a linked list of DMA_DESCRIPTOR_REGS type descriptor chain.

Returns

True - If transfer request is accepted.

False - If previous transfer is in progress and the request is rejected.

Example

// Process a transfer list called transferList. Refer to the DMA PLIB demo
// application example for more details on usage.

static DMA_DESCRIPTOR_REGS dmaDescRegs[3] = {0};
    
    // Populate the DMA linked list in dmaDescRegs
    DMA_LinkedListDescSetup();
    
    if (DMA_ChannelLinkedListTransfer(DMA_CHANNEL_0, dmaDescRegs) == true)
    {
        // do something else
    }
    else
    {
        // try again?
    }

Remarks

None.