/* Sets the control parameters for a DMA channel. 
Choose the the Circular mode from one of  */
void DMAChannelControlSet(unsigned long ulChannelID, unsigned long ulControl)
/* Sets the control parameters for a DMA channel. 
Choose the the Circular mode from one of  */
void DMAChannelControlSet(unsigned long ulChannelID, unsigned long ulControl)
{
    unsigned long ulTmpReg  = 0 ;
    unsigned long ulRegMask =
           ( DMA_MEM_WIDTH_8BIT | DMA_MEM_WIDTH_16BIT | DMA_MEM_WIDTH_32BIT |
             DMA_PER_WIDTH_8BIT | DMA_PER_WIDTH_16BIT | DMA_PER_WIDTH_32BIT |
             DMA_MEM_DIR_INC    | DMA_MEM_DIR_FIXED   |
             DMA_PER_DIR_INC    | DMA_PER_DIR_FIXED   |
             DMA_MODE_CIRC_EN   | DMA_MODE_CIRC_DIS   );
    xASSERT(xDMAChannelIDValid(ulChannelID));
    xASSERT((ulControl & ulRegMask) != 0);
    ulTmpReg = xHWREG(g_psDMAChannel[ulChannelID]);
    ulTmpReg &= ~ulRegMask;
    ulTmpReg |= ulControl;
    xHWREG(g_psDMAChannel[ulChannelID]) = ulTmpReg;
}