Skip to main content
keaven
Associate III
August 18, 2015
Question

void ADC_IRQHandler(void) Question

  • August 18, 2015
  • 3 replies
  • 732 views
Posted on August 18, 2015 at 22:24

I think I know the answer but I just want to be sure. Is there any way to know from which ADC the handler is called? If I am using the 3 ADCs do I need to call the HAL_ADC_IRQHandler() for all like below?

void ADC_IRQHandler(void)
{
HAL_ADC_IRQHandler(&hADC1);
HAL_ADC_IRQHandler(&hADC2);
HAL_ADC_IRQHandler(&hADC3);
}

Thank you
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    August 18, 2015
    Posted on August 18, 2015 at 23:02

    I'm sure each ADC has it's own status register flagging the source, and I'd expect the HAL handler to check this as the first order of business.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    jpeacock
    Associate
    August 18, 2015
    Posted on August 18, 2015 at 23:03

    You can read the interrupt vector at SCB->ICSR, in the low order bits.  I use it with a reentrant ADC interrupt handler to determine which converter is requesting service.

      Jack Peacock
    keaven
    keavenAuthor
    Associate III
    August 19, 2015
    Posted on August 19, 2015 at 15:43

    Thank you guys!