diff --git a/include/libopencm3/stm32/common/exti_common_v2.h b/include/libopencm3/stm32/common/exti_common_v2.h index e74c7517..d6ddb24a 100644 --- a/include/libopencm3/stm32/common/exti_common_v2.h +++ b/include/libopencm3/stm32/common/exti_common_v2.h @@ -44,17 +44,6 @@ /** EXTI Software Interrupt Event Register */ #define EXTI_SWIER1 MMIO32(EXTI_BASE + 0x08) -/** EXTI Rising Edge Pending Register */ -#define EXTI_RPR1 MMIO32(EXTI_BASE + 0x0c) -/** EXTI Falling Edge Pending Register */ -#define EXTI_FPR1 MMIO32(EXTI_BASE + 0x10) - -/** EXTI External Interrupt Selection Registers */ -#define EXTI_EXTICR(i) MMIO32(EXTI_BASE + 0x60 + (i)*4) -#define EXTI_EXTICR1 MMIO32(EXTI_BASE + 0x60) -#define EXTI_EXTICR2 MMIO32(EXTI_BASE + 0x64) -#define EXTI_EXTICR3 MMIO32(EXTI_BASE + 0x68) -#define EXTI_EXTICR4 MMIO32(EXTI_BASE + 0x6c) /** EXTI Interrupt Mask Registers 1 */ #define EXTI_IMR1 MMIO32(EXTI_BASE + 0x80) diff --git a/include/libopencm3/stm32/exti.h b/include/libopencm3/stm32/exti.h index e34b7f09..0a6df03f 100644 --- a/include/libopencm3/stm32/exti.h +++ b/include/libopencm3/stm32/exti.h @@ -42,6 +42,8 @@ # include #elif defined(STM32G0) # include +#elif defined(STM32H7) +# include #else # error "stm32 family not defined." #endif diff --git a/include/libopencm3/stm32/g0/exti.h b/include/libopencm3/stm32/g0/exti.h index aecd5e17..e4e8f1fd 100644 --- a/include/libopencm3/stm32/g0/exti.h +++ b/include/libopencm3/stm32/g0/exti.h @@ -32,6 +32,18 @@ #include #include +/** EXTI External Interrupt Selection Registers */ +#define EXTI_EXTICR(i) MMIO32(EXTI_BASE + 0x60 + (i)*4) +#define EXTI_EXTICR1 MMIO32(EXTI_BASE + 0x60) +#define EXTI_EXTICR2 MMIO32(EXTI_BASE + 0x64) +#define EXTI_EXTICR3 MMIO32(EXTI_BASE + 0x68) +#define EXTI_EXTICR4 MMIO32(EXTI_BASE + 0x6c) + +/** EXTI Rising Edge Pending Register */ +#define EXTI_RPR1 MMIO32(EXTI_BASE + 0x0c) +/** EXTI Falling Edge Pending Register */ +#define EXTI_FPR1 MMIO32(EXTI_BASE + 0x10) + BEGIN_DECLS END_DECLS diff --git a/include/libopencm3/stm32/h7/exti.h b/include/libopencm3/stm32/h7/exti.h new file mode 100644 index 00000000..86b2d856 --- /dev/null +++ b/include/libopencm3/stm32/h7/exti.h @@ -0,0 +1,43 @@ +/** @defgroup exti_defines EXTI Defines + * + * @ingroup STM32H7xx_defines + * + * @brief Defined Constants and Types for the STM32H7xx EXTI Control + * + * @version 1.0.0 + * + * LGPL License Terms @ref lgpl_license + * */ +/* + * This file is part of the libopencm3 project. + * + * This library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library. If not, see . + */ +/**@{*/ +#ifndef LIBOPENCM3_EXTI_H +#define LIBOPENCM3_EXTI_H + +#include +#include + +/** EXTI CPU Event Pending Register 1 */ +#define EXTI_CPUPR1 MMIO32(EXTI_BASE + 0x88) +#define EXTI_PR EXTI_CPUPR1 + +BEGIN_DECLS + +END_DECLS + +#endif /* LIBOPENCM3_EXTI_H */ +/**@}*/ diff --git a/include/libopencm3/stm32/h7/syscfg.h b/include/libopencm3/stm32/h7/syscfg.h index b6662c8e..110df1f7 100644 --- a/include/libopencm3/stm32/h7/syscfg.h +++ b/include/libopencm3/stm32/h7/syscfg.h @@ -37,6 +37,7 @@ /**@defgroup syscfg_registers SYSCFG Registers  @{*/ #define SYSCFG_PMCR MMIO32(SYSCFG_BASE + 0x04) +#define SYSCFG_EXTICR(i) MMIO32(SYSCFG_BASE + 0x08 + (i)*4) #define SYSCFG_EXTICR1 MMIO32(SYSCFG_BASE + 0x08) #define SYSCFG_EXTICR2 MMIO32(SYSCFG_BASE + 0x0C) #define SYSCFG_EXTICR3 MMIO32(SYSCFG_BASE + 0x10) @@ -48,8 +49,12 @@ #define SYSCFG_PWRCR MMIO32(SYSCFG_BASE + 0x2C) #define SYSCFG_PKGR MMIO32(SYSCFG_BASE + 0x124) #define SYSCFG_UR(n) MMIO32(SYSCFG_BASE + 0x300 + (4 * (n))) + +#define SYSCFG_EXTICR_FIELDSIZE 4 /**@}*/ + + /** @defgroup syscfg_pwrcr PWRCR SYSCFG configuration register * @ingroup syscfg_registers * @{*/ diff --git a/lib/stm32/h7/Makefile b/lib/stm32/h7/Makefile index 2e71415c..181ec524 100644 --- a/lib/stm32/h7/Makefile +++ b/lib/stm32/h7/Makefile @@ -38,6 +38,7 @@ TGT_CFLAGS += $(STANDARD_FLAGS) ARFLAGS = rcs OBJS += dac_common_all.o +OBJS += exti_common_all.o OBJS += flash_common_all.o flash_common_f.o flash_common_f24.o OBJS += fmc_common_f47.o OBJS += gpio_common_all.o gpio_common_f0234.o