This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CSL DMA_getStatus confusion

Guru 15580 points

As I understand it, the DMA_getStatus function is supposed to :

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

However, the inline code in csl_dma.h appears to check the Enable bit instead of the Status bit of the Transfer Control Register. For example

static inline
Int DMA_getStatus (
/** Pointer to the object that holds reference to the
* DMA handle object.
*/
CSL_DMA_Handle hDMA
)
{
Int status;
Uint16 chanNum;

if(hDMA != NULL)
{
chanNum = hDMA->chanNum;

while(chanNum >= CSL_DMA_PER_CNT)
{
chanNum = chanNum - CSL_DMA_PER_CNT;
}

switch((CSL_DMAChanNum)chanNum)
{
case CSL_DMA_CHAN0:
status = CSL_FEXT(hDMA->dmaRegs->DMACH0TCR2, DMA_DMACH0TCR2_EN);
break;
case CSL_DMA_CHAN1:
status = CSL_FEXT(hDMA->dmaRegs->DMACH1TCR2, DMA_DMACH1TCR2_EN);
break;
case CSL_DMA_CHAN2:
status = CSL_FEXT(hDMA->dmaRegs->DMACH2TCR2, DMA_DMACH2TCR2_EN);
break;
case CSL_DMA_CHAN3:
status = CSL_FEXT(hDMA->dmaRegs->DMACH3TCR2, DMA_DMACH3TCR2_EN);
break;
}
}
else
{
status = CSL_ESYS_BADHANDLE;
}

return status;
}

I can't seem to find the #define for DMA_DMACH1TCR2_EN in the csl,  but it sure looks like it is checking the Enable bit and not the Status bit.

Can someone provide guidance on this?