stm32f3: adding external interrupts support.

This commit is contained in:
Federico Ruiz Ugalde
2013-06-26 01:59:04 -06:00
committed by Piotr Esden-Tempski
parent 78236d6e00
commit 49fe59e82d
3 changed files with 25 additions and 5 deletions

View File

@@ -32,6 +32,17 @@
#define EXTI_SWIER MMIO32(EXTI_BASE + 0x10) #define EXTI_SWIER MMIO32(EXTI_BASE + 0x10)
#define EXTI_PR MMIO32(EXTI_BASE + 0x14) #define EXTI_PR MMIO32(EXTI_BASE + 0x14)
#if defined (STM32F3)
#define EXTI_IMR2 MMIO32(EXTI_BASE + 0x18)
#define EXTI_EMR2 MMIO32(EXTI_BASE + 0x1C)
#define EXTI_RTSR2 MMIO32(EXTI_BASE + 0x20)
#define EXTI_FTSR2 MMIO32(EXTI_BASE + 0x24)
#define EXTI_SWIER2 MMIO32(EXTI_BASE + 0x28)
#define EXTI_PR2 MMIO32(EXTI_BASE + 0x2C)
#endif
/* EXTI number definitions */ /* EXTI number definitions */
#define EXTI0 (1 << 0) #define EXTI0 (1 << 0)
#define EXTI1 (1 << 1) #define EXTI1 (1 << 1)
@@ -53,10 +64,15 @@
#define EXTI17 (1 << 17) #define EXTI17 (1 << 17)
#define EXTI18 (1 << 18) #define EXTI18 (1 << 18)
#define EXTI19 (1 << 19) #define EXTI19 (1 << 19)
#if !defined(STM32F3)
#define EXTI20 (1 << 20) #define EXTI20 (1 << 20)
#define EXTI21 (1 << 21) #define EXTI21 (1 << 21)
#define EXTI22 (1 << 22) #define EXTI22 (1 << 22)
#endif
/* Trigger types */ /* Trigger types */
typedef enum trigger_e { typedef enum trigger_e {
EXTI_TRIGGER_RISING, EXTI_TRIGGER_RISING,

View File

@@ -25,6 +25,8 @@
#include <libopencm3/stm32/syscfg.h> #include <libopencm3/stm32/syscfg.h>
#if defined(STM32F2) #if defined(STM32F2)
#include <libopencm3/stm32/f2/gpio.h> #include <libopencm3/stm32/f2/gpio.h>
#elif defined(STM32F3)
#include <libopencm3/stm32/f3/gpio.h>
#elif defined(STM32F4) #elif defined(STM32F4)
#include <libopencm3/stm32/f4/gpio.h> #include <libopencm3/stm32/f4/gpio.h>
#elif defined(STM32L1) #elif defined(STM32L1)
@@ -141,23 +143,25 @@ void exti_select_source(uint32_t exti, uint32_t gpioport)
case GPIOE: case GPIOE:
bits = 0xb; bits = 0xb;
break; break;
#if defined(STM32L1) #if !defined(STM32L1)
#else
case GPIOF: case GPIOF:
bits = 0xa; bits = 0xa;
break; break;
#if !defined(STM32F3)
case GPIOG: case GPIOG:
bits = 0x9; bits = 0x9;
break; break;
#endif #endif
#endif
#if !defined(STM32F3)
case GPIOH: case GPIOH:
bits = 0x8; bits = 0x8;
break; break;
#if defined(STM32L1) #if !defined(STM32L1)
#else
case GPIOI: case GPIOI:
bits = 0x7; bits = 0x7;
break; break;
#endif
#endif #endif
} }

View File

@@ -34,7 +34,7 @@ CFLAGS = -Os -g \
# ARFLAGS = rcsv # ARFLAGS = rcsv
ARFLAGS = rcs ARFLAGS = rcs
OBJS = rcc.o gpio.o flash.o adc.o OBJS = rcc.o gpio.o flash.o adc.o exti2.o
OBJS += gpio_common_all.o gpio_common_f234.o i2c_common_all.o\ OBJS += gpio_common_all.o gpio_common_f234.o i2c_common_all.o\
dac_common_all.o dac_common_all.o