Is it possible to use analog watchdog without adc interrupt?
I am thinking of turning on ADC with DMA when analog watchdog detect certain level of signal. Then I would like to turn on ADC with only watchdog first and when LevelOutOfWindowCallback() is called ADC with DMA starts. I tried code below but it didn't work. It seems that watchdog never started or worked.
Please teach me how to do that.
Thank you.
int main(void){
configurations
HAL_ADC_Start(&hadc1);
ADC1->CR1|=(1<<23);
ADC1->CR1|=(1<<1);
ADC1->SR &= ~(1 << 0);
HAL_TIM_Base_Start(&htim2);
while(1){
}
}
void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc){
HAL_ADC_Start_DMA(&hadc1,(uint32_t*)DMA_buf,sizeof(DMA_buf)/sizeof(DMA_buf[0]));
}