/* Configure the size of the source or destination data circular buffer used by the DMA Controller .  */
void DMATransferAddressModulo(unsigned long ulChannelID, unsigned long ulModVal, unsigned long ulAddrType)
/* Configure the size of the source or destination data circular buffer used by the DMA Controller .  */
void DMATransferAddressModulo(unsigned long ulChannelID, unsigned long ulModVal, unsigned long ulAddrType)
{
    xASSERT(xDMAChannelIDValid(ulChannelID));
    xASSERT((ulAddrType == DMA_MOD_SMODE) || (ulAddrType == DMA_MOD_DMODE));
    xASSERT((ulModVal >= 0) || (ulModVal < 16));
    if(ulAddrType == DMA_MOD_SMODE)
    {
        xHWREG(g_psDMAChannelAddress[ulChannelID] + DMA_DCR) &= ~DMA_DCR_SMOD_M;
        xHWREG(g_psDMAChannelAddress[ulChannelID] + DMA_DCR) |= (ulModVal << 12);  
    }
    else
    {
        xHWREG(g_psDMAChannelAddress[ulChannelID] + DMA_DCR) &= ~DMA_DCR_DMOD_M;
        xHWREG(g_psDMAChannelAddress[ulChannelID] + DMA_DCR) |= (ulModVal << 8);
    }
}