What is the right way to read several ADC channels in autonomous way?
I have a STM32L011-Nucleo board, and I'd like to make a simple code to read two ADC channels independent to the main code (interrupt or DMA mode).
HAL library is a bit confusing for me so I'd be glas to see the right set of functions to use.
So first I need to set up ADC and DMA in STM32CubeMX which looks straight forward.
After that I need to initialize the variable to store the data from ADC:
uint16_t ADCres[2];After that I should run ADC in DMA mode:
HAL_ADC_Start_DMA(&hadc, ADCres, 2);That is it? Can I just read the ADCre[0] and ADCres[1] variables after that to have the very last measures?
In some tutorials there was HAL_ADC_ConvCpltCallbach function which looks not really necessary for me (in tutorials they just copied the values from one place to another after the ADC cicle ended).