Question
Reading ADC Channels at once Callback
Hello Team,
I'm pretty new to the field of the embedded systems. I want to read two adc channel at once Callback function. The ADC conversion should start at every timer8 update event. I wrote a code below for that but adc channels are read two different calls there. I want to read both channels at the same call. Is there any way to do that?
void HAL_ADC_ConvCpltCallback (ADC_HandleTypeDef* hadc) // ADC Interrupt function
{
if(hadc == &hadc1)
{
switch (count)
{
case 0:
adcValue[0] = HAL_ADC_GetValue(&hadc1);
break;
case 1:
adcValue[1] = HAL_ADC_GetValue(&hadc1);
break;
}
count ++;
if(count == 2) count = 0;
HAL_ADC_Start(hadc); // start adc
}
}


