[En-Nut-Discussion] STM32 hardware Interrupts for controller specific drivers

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Tue Apr 15 11:19:16 CEST 2014


>>>>> "Holger" == Holger Mai, GEMAC <mai at gemac.info> writes:

    Holger> Hello all is it possible to use "normal" hardware interrupts
    Holger> (outside the NutOS Interrupts), or alternateive: how can i
    Holger> extend the NutOS own Interrupts? I need two SDIO-Interrupts, but
    Holger> i did not found any SDIO interrupt hints in the NutOS Sources.
    Holger> Exists an explanation of the NutOS Interrupt handling system and
    Holger> how it does work?
Appended patch should make the SDIO interrupt accessible.

Can you test and report?
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>From 64b7a4888bab715011535616100095f84c55b1cf Mon Sep 17 00:00:00 2001
From: Uwe Bonnes <bon at elektron.ikp.physik.tu-darmstadt.de>
Date: Tue, 15 Apr 2014 11:16:16 +0200
Subject: stm32/sdio: Make the SDIO IRQ accessible.

---
 nut/arch/cm3/dev/stm/ih_stm32.c         | 3 +++
 nut/conf/arch/cm3/stm32f2.nut           | 1 +
 nut/include/arch/cm3/stm/stm32_irqreg.h | 1 +
 3 files changed, 5 insertions(+)

diff --git a/nut/arch/cm3/dev/stm/ih_stm32.c b/nut/arch/cm3/dev/stm/ih_stm32.c
index 5b65520..d7306c1 100644
--- a/nut/arch/cm3/dev/stm/ih_stm32.c
+++ b/nut/arch/cm3/dev/stm/ih_stm32.c
@@ -74,6 +74,9 @@ CREATE_HANDLER(RTC,           RTC,      NUT_IRQPRI_DEF);    // Real Time Clock
 #if defined(HW_RTC_STM32_V2)
 CREATE_HANDLER(RTC,           RTC_Alarm,NUT_IRQPRI_DEF);    // Real Time Clock
 #endif
+#if defined(HW_SDIO_STM32)
+CREATE_HANDLER(SDIO,          SDIO,     NUT_IRQPRI_DEF);    // SDIO
+#endif
 CREATE_HANDLER(SPI1,          SPI1,     NUT_IRQPRI_DEF);     // SPI 1 Controller
 #if defined(HW_SPI2_STM32)
 CREATE_HANDLER(SPI2,          SPI2,     NUT_IRQPRI_DEF);     // SPI 2 Controller
diff --git a/nut/conf/arch/cm3/stm32f2.nut b/nut/conf/arch/cm3/stm32f2.nut
index cca7a92..b85b7f8 100644
--- a/nut/conf/arch/cm3/stm32f2.nut
+++ b/nut/conf/arch/cm3/stm32f2.nut
@@ -76,6 +76,7 @@ nutarch_cm3_stm32f2 =
                     "HW_I2C2_STM32",
                     "HW_I2C3_STM32",
                     "HW_RNG_STM32",
+                    "HW_SDIO_STM32",
                     "HW_SPI1_STM32",
                     "HW_SPI2_STM32",
                     "HW_SPI3_STM32",
diff --git a/nut/include/arch/cm3/stm/stm32_irqreg.h b/nut/include/arch/cm3/stm/stm32_irqreg.h
index 5e0d227..5967bbe 100644
--- a/nut/include/arch/cm3/stm/stm32_irqreg.h
+++ b/nut/include/arch/cm3/stm/stm32_irqreg.h
@@ -47,6 +47,7 @@ extern IRQ_HANDLER sig_INTERRUPT4;      // EXTI 4
 extern IRQ_HANDLER sig_INTERRUPT9_5;    // EXTI 9_5
 extern IRQ_HANDLER sig_INTERRUPT15_10;  // EXTI 15_10
 extern IRQ_HANDLER sig_RTC;         // Real Time Clock
+extern IRQ_HANDLER sig_SDIO;        // SDIO Controller
 extern IRQ_HANDLER sig_SPI1;        // SPI 1 Controller
 extern IRQ_HANDLER sig_SPI2;        // SPI 2 Controller
 extern IRQ_HANDLER sig_TWI1_EV;     // I2C 1 Data/Event
-- 
1.8.4.5



More information about the En-Nut-Discussion mailing list