2021-07-18 10:24 PM
I enable three ADC. ADC1, ADC2, ADC3.
example:
I enable these DMA, DMA2_Stream1_IRQHandler, DMA2_Stream2_IRQHandler, DMA2_Stream4_IRQHandler. Each DMA IRQ handler having each HAL_DMA_IRQHandler().
But ADC_IRQHandler() having three HAL_ADC_IRQHandler(). In this case some time i want ADC1 interrupt only, but ADC interrupt enable means all HAL_ADC_IRQHandler() is executed.
Is there any separate IRQ_Handler for Three ADC.
Thanks
Manikandan D
2021-07-19 07:15 AM
What chip? On some, a single interrupt exists for all ADCs.
If you only want ADC1 interrupts, ensure interrupts are not enabled on the other two ADCs.
Since HAL_ADC_IRQHandler checks for both the interrupt flag and the interrupt enable flag, there are no side effects other than lost processor cycles of calling it on, say, ADC2 if ADC2 interrupts are disabled.
2021-07-19 08:42 AM
You can always dispense with the HAL stuff and create something more tailored based on an actual understanding of the hardware, algorithms, etc.
The HAL_ADC_IRQHandler() is a common sink point for identifying the instance and interrupt source, and managing/calling the call back routines you've specified.
It is a rather heavy abstraction at times, and you're obviously free to code a different/better solution, and use whatever individual IRQ handlers the NVIC/ADC support on your specific STM32
2021-07-19 11:02 PM
Board : STM32F746G
Is there any individual ADC_IRQHandler() for All ADC. like ADC1_IRQHandler() , ADC2_IRQHandler(), ADC3_IRQHandler().
In my code:
ADC_IRQHandler()
{
HAL_ADC_IRQHandler(&hadc1);
HAL_ADC_IRQHandler(&hadc2);
HAL_ADC_IRQHandler(&hadc3);
}
But my expectation:
ADC1_IRQHandler()
{
HAL_ADC_IRQHandler(&hadc1);
}
ADC2_IRQHandler()
{
HAL_ADC_IRQHandler(&hadc2);
}
ADC3_IRQHandler()
{
HAL_ADC_IRQHandler(&hadc3);
}
Thanks
Manikandan D
2021-07-20 06:14 AM
The STM32F7 has a single interrupt for all ADCs. It's not something you can change.
Some interrupts are shared between peripherals, you can look at the vector table to see.
2021-07-21 10:18 PM
Thank you for your answer @TDK