Hi Ma Hui,
I'm attempting to port the code example you've provided to the FRDM-KV31F platform using MCUXpresso. At a customer's request, I'm writing register level code, and trying to minimize abstraction, so I'm not using the KSDK.
My questions are around the DMAMUX configuration for this part.
I've been looking through the dma_request_source_t table to find appropriate values for both the DMA and ADC0 source.
I've found the correct value for the ADC0 to be 0x40 for the DMAMUX->CHCFG[1]. I'm having trouble locating the correct value to enter into the DMAMUX->CHCFG[0] for the DMA Source.
Any help in this porting effort would be greatly appreciated.
//****************************************************************************
//**** DMA channel 0, use for Write ADC mux channel, form SRAM to ADC ********
//****************************************************************************
DMAMUX->CHCFG[0] = DMAMUX_CHCFG_ENBL_MASK|DMAMUX_CHCFG_SOURCE(0x36); //DMA source DMA Mux
//****************************************************************************
//**** DMA channel 1, use for Read ADC result data, form ADC to SRAM *********
//****************************************************************************
//NVIC_SetIsr(INT_DMA1,2); //17
DMAMUX->CHCFG[1] = DMAMUX_CHCFG_ENBL_MASK|DMAMUX_CHCFG_SOURCE(kDmaRequestMux0ADC0); //DMA source ADC0
Bets regards,
Josh