/* Gets the transfer mode for a uDMA channel control structure. */
unsigned long uDMAChannelModeGet(unsigned long ulChannelStructIndex)
/* Gets the transfer mode for a uDMA channel control structure. */
unsigned long uDMAChannelModeGet(unsigned long ulChannelStructIndex)
{
    tDMAControlTable *pControlTable;
    unsigned long ulControl;
    ASSERT((ulChannelStructIndex & 0xffff) < 64);
    ASSERT(HWREG(UDMA_CTLBASE) != 0);
    ulChannelStructIndex &= 0x3f;
    pControlTable = (tDMAControlTable *)HWREG(UDMA_CTLBASE);
    ulControl = (pControlTable[ulChannelStructIndex].ulControl &
                 UDMA_CHCTL_XFERMODE_M);
    if(((ulControl & ~UDMA_MODE_ALT_SELECT) == UDMA_MODE_MEM_SCATTER_GATHER) ||
       ((ulControl & ~UDMA_MODE_ALT_SELECT) == UDMA_MODE_PER_SCATTER_GATHER))
    {
        ulControl &= ~UDMA_MODE_ALT_SELECT;
    }
    return(ulControl);
}