[En-Nut-Discussion] How to handle STM32 combined interrupts

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Wed Dec 17 15:40:10 CET 2014


STM32 devices have a some "combined" interrupts, like e.g. TIM1_UP_TIM10
meaning the Update event of Timer 1 _and_ all events of Timer 10 may
generate the interrupt.
E.g. EXTI15_10 combines the internal interrupts form Pin 10 to Pin 15 of
selected ports. As the signal sources are all similar and the Gpio Api
already uses a special GPIO_SIGNAL *, this can be done with a single
redirection layer, as done in /arch/cm3/dev/stm/stm32_gpioirq.c.

However a generic way to handle combined "disjuct" signals would need
something like

SIGNAL * sig;
sig = NutGetSignal( IRQ_SOURCE);
if (sig) {
   res = NutRegisterSignalHandler(sig, void (*handler) (void *),
   void *arg);
   res |= NutSignalEnable(sig);

instead of
   int res;
   IRQ_HANDLER * irh = &Sig_XXX;
   res = NutRegisterIrqHandler(irh, void (*handler) (void *),
   void *arg);
   res != NutIrqEnable(irh)

Another solution is to leave everything to the use.

Any thoughts about that problem?


Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

More information about the En-Nut-Discussion mailing list