Solved
HAL_ADCEx_Calibration_Start
Just a question: I'm using the following code snippet:
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if (htim == mod_timer){
pwm_timer->Instance->CCR4 = sinetab[loop_cnt++]*global_adc1/4096.; //setzt neuen PWM-Wert aus Tabelle
if(loop_cnt == MAX_SAMPLES){
loop_cnt=0;
HAL_ADC_Start_IT(&hadc1);
HAL_GPIO_WritePin(LED_GPIO_Port,LED_Pin, SET);
}
}
}
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc)
{
global_adc1= HAL_ADC_GetValue(hadc);
HAL_GPIO_WritePin(LED_GPIO_Port,LED_Pin,RESET);
}
Do I have to care about HAL_ADCEx_Calibration_Start(&hadc1 );
If yes, I assume I would do that once in program start in main()? And how do I wait for calibration completion?
