I use the DMA to Trigger ADC,
DMA CH0 -> ADC0 CH0 CH1 CH4
DMA CH1 -> ADC0 CH8 CH9 CH12 CH13
Here is part of my code.
/* Set trigger configuration. */
LPADC_GetDefaultConvTriggerConfig(&lpadcTriggerConfig);
lpadcTriggerConfig.targetCommandId = chainedCommandList[0];
lpadcTriggerConfig.enableHardwareTrigger = TRUE;
LPADC_SetConvTriggerConfig(halAdcConfig->base, (eHAL_TRIGGER_ID)triId, &lpadcTriggerConfig);
/*==========================
* ADC0 with DMA0 channel0
*==========================*/
/* Configure DMA channel for ADC1 FIFO transfer */
channel = eHAL_DMA_CHANNEL0;
irq = DMA_CH0_IRQn;
/* Cehck DMA channel is not Initialized */
ASSERT(!HAL_DMA_IsChannelInitialized(eHAL_DMA0, channel));
/* Set EDMA channel configuration parameters */
lpadcDmaChnlConfig.channelDataSignExtensionBitPosition = 0U;
lpadcDmaChnlConfig.channelPreemptionConfig.enableChannelPreemption = FALSE;
lpadcDmaChnlConfig.channelPreemptionConfig.enablePreemptAbility = TRUE;
lpadcDmaChnlConfig.channelRequestSource = kDma0RequestMuxAdc1FifoRequest;
lpadcDmaChnlConfig.protectionLevel = kEDMA_ChannelProtectionLevelUser;
/* Configure EDMA channel for one shot transfer */
edma_config_t userConfig;
/*
* config.enableContinuousLinkMode = false;
* config.enableHaltOnError = true;
* config.enableRoundRobinArbitration = false;
* config.enableDebugMode = false;
*/
EDMA_GetDefaultConfig(&userConfig);
EDMA_Init(base, &userConfig);
/* Set source address to ADC1 FIFO register */
srcAddr = (UINT32 *)&(s_adcConfig[eHAL_ADC1].base->RESFIFO);
destAddr = (UINT32 *)adcRawValue;
/* Prepare transfer configuration for one-shot peripheral-to-memory transfer */
EDMA_PrepareTransfer(&transferConfig,
srcAddr , sizeof(UINT32),
&destAddr[ADC1_DMA_DEST_START], sizeof(destAddr[0]),
sizeof(destAddr[0]),
sizeof(UINT32) * ADC1_DMA_DEST_LENGTH,
kEDMA_PeripheralToMemory);
/* Used to change the destination address to the original value */
transferConfig.dstMajorLoopOffset = (INT32)((-1) * sizeof(UINT32) * ADC1_DMA_DEST_LENGTH);