Logo Search packages:      
Sourcecode: linux version File versions  Download package

void dmacHw_initDma ( void   )

Initializes DMA.

This function initializes DMA CSP driver

Note:
Must be called before using any DMA channel

Definition at line 226 of file dmacHw.c.

{

      uint32_t i = 0;

      dmaChannelCount_0 = dmacHw_GET_NUM_CHANNEL(0);
      dmaChannelCount_1 = dmacHw_GET_NUM_CHANNEL(1);

      /* Enable access to the DMA block */
      chipcHw_busInterfaceClockEnable(chipcHw_REG_BUS_CLOCK_DMAC0);
      chipcHw_busInterfaceClockEnable(chipcHw_REG_BUS_CLOCK_DMAC1);

      if ((dmaChannelCount_0 + dmaChannelCount_1) > dmacHw_MAX_CHANNEL_COUNT) {
            dmacHw_ASSERT(0);
      }

      memset((void *)dmacHw_gCblk, 0,
             sizeof(dmacHw_CBLK_t) * (dmaChannelCount_0 + dmaChannelCount_1));
      for (i = 0; i < dmaChannelCount_0; i++) {
            dmacHw_gCblk[i].module = 0;
            dmacHw_gCblk[i].channel = i;
      }
      for (i = 0; i < dmaChannelCount_1; i++) {
            dmacHw_gCblk[i + dmaChannelCount_0].module = 1;
            dmacHw_gCblk[i + dmaChannelCount_0].channel = i;
      }
}

Generated by  Doxygen 1.6.0   Back to index