#define SOURCEARRAYSIZE (18) //need 16, 2 extra /* Source and destination DMA areas */ static uint32_t source[SOURCEARRAYSIZE], dest[SOURCEARRAYSIZE]; static void setupDMA(void) { /* Initialize GPDMA controller */ Chip_GPDMA_Init(LPC_GPDMA); /* Get DMA channel */ dmaCh = Chip_GPDMA_GetFreeChannel(LPC_GPDMA, GPDMA_CONN_HSADC_READ); /* Setup DMA transfer */ Chip_GPDMA_Transfer(LPC_GPDMA, dmaCh, GPDMA_CONN_HSADC_READ, (uint32_t) &dest[0], GPDMA_TRANSFERTYPE_P2M_CONTROLLER_DMA, 8); /* Enable GPDMA interrupt */ NVIC_EnableIRQ(DMA_IRQn); } |