ADC1的设置如下:
ADC2的设置如下:
ADC2的DMA不用设置
主函数中使用下面语句进行同时采集:
HAL_ADCEx_MultiModeStart_DMA(&hadc1, (uint32_t *)ADC1_2Data,ADC_SIZE);
数组ADC1_2Data需要指定ram地址进行定义,如下:
///ALIGN_32BYTES 把地址进行32字节对齐,避免使用dcache指令出错
ALIGN_32BYTES (static uint16_t ADC1Data[ADC_SIZE]) __attribute__((section(".ARM.__at_0x24000000")));
采集后的数据,ADC1在ADC1_2Data[]的低16bit,ADC2在ADC1_2Data[]的高16bit