- Main Page
- Modules
- Data Structures
- Files

Functions
DMA Inline Function
DMA

## Functions
static Int | DMA_getStatus (CSL_DMA_Handle hDMA)

## Function Documentation

static Int DMA_getStatus | ( | CSL_DMA_Handle | hDMA | ) | `[inline, static]`

===========================================================================
DMA_getStatus

Description
This function return the status whether data transfer has done or not as per passed CSL_DMA_Handle.

Arguments

                hDMA            Handle to the DMA

Return Value Int

- 0 - Data Transfer done
- 1 - Data Transfer is happening.
- CSL_ESYS_BADHANDLE - Invalid DMA handle

Pre Condition
1. DMA_open() must be called successfully before this function call 2. Call DMA_config() for the handle return by DMA_open() 3. Start trasfer by calling DMA_start().

Post Condition
This checking is applicable for Transfer in Polling mode.

Modifies
None

Example

            #define CSL_DMA_BUFFER_SIZE 1024

                CSL_DMA_Handle       hDMA;
                CSL_DMA_Config       pConfig;
                CSL_status           status;
                CSL_DMAChanNum       chanNum;
                CSL_DMA_ChannelObj   pDmaChanObj
                Int                  dmaStatus;

            Uint16 dmaSRCBuff[CSL_DMA_BUFFER_SIZE];
            Uint16 dmaDESTBuff[CSL_DMA_BUFFER_SIZE];

                chanNum = CSL_DMA_CHAN0;
                hDMA = DMA_open(chanNum, &pDmaChanObj, &status);

    #if (defined(CHIP_C5505_C5515) || defined(CHIP_C5504_C5514))
                pConfig.pingPongMode = CSL_DMA_PING_PONG_DISABLE;
    #endif

                pConfig.autoMode     = CSL_DMA_AUTORELOAD_DISABLE;
                pConfig.burstLen     = CSL_DMA_TXBURST_8WORD;
                pConfig.trigger      = CSL_DMA_SOFTWARE_TRIGGER;
                pConfig.dmaEvt       = CSL_DMA_EVT_NONE;
                pConfig.dmaInt       = CSL_DMA_INTERRUPT_DISABLE;
                pConfig.chanDir      = CSL_DMA_READ;
                pConfig.trfType      = CSL_DMA_TRANSFER_MEMORY;
                pConfig.dataLen      = CSL_DMA_BUFFER_SIZE * 2;
                pConfig.srcAddr      = (Uint32)dmaSRCBuff;
                pConfig.destAddr     = (Uint32)dmaDESTBuff;

                status = DMA_Config(hDMA, &pConfig);

                status = DMA_start (hDMA);

                dmaStatus = DMA_getStatus (hDMA);

===========================================================================

Parameters:

  hDMA | Pointer to the object that holds reference to the DMA handle object.

References CSL_DMA_ChannelObj::chanNum, CSL_DMA_CHAN0, CSL_DMA_CHAN1, CSL_DMA_CHAN2, CSL_DMA_CHAN3, and CSL_DMA_ChannelObj::dmaRegs.