From 553c876fa5b81f4a3ba1bcd0714e95552f100e00 Mon Sep 17 00:00:00 2001 From: Guillaume Revaillot Date: Mon, 28 Jan 2019 18:53:10 +0100 Subject: [PATCH] stm32: exti: define AFIO/SYSCFG_EXTICR_FIELDSIZE for all chip. While on all current chips, exticr gpio port mux selection is coded on 4 bits, stm32g0 EXTI_EXTICR register uses 8 bits. Align all exti header to reference that value (was previously defined for f0 as SYCFG_EXTICR_SKIP) --- include/libopencm3/stm32/common/syscfg_common_l1f234.h | 4 ++++ include/libopencm3/stm32/f0/syscfg.h | 2 +- include/libopencm3/stm32/f1/gpio.h | 8 ++++---- include/libopencm3/stm32/l0/syscfg.h | 1 + include/libopencm3/stm32/l4/syscfg.h | 1 + 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/libopencm3/stm32/common/syscfg_common_l1f234.h b/include/libopencm3/stm32/common/syscfg_common_l1f234.h index 776e12da..5e7f2d42 100644 --- a/include/libopencm3/stm32/common/syscfg_common_l1f234.h +++ b/include/libopencm3/stm32/common/syscfg_common_l1f234.h @@ -50,6 +50,10 @@ specific memorymap.h header before including this header file.*/ #define SYSCFG_CMPCR MMIO32(SYSCFG_BASE + 0x20) +/* --- SYSCFG_EXTICR Values -------------------------------------------------*/ + +#define SYSCFG_EXTICR_FIELDSIZE 4 + #endif /**@}*/ diff --git a/include/libopencm3/stm32/f0/syscfg.h b/include/libopencm3/stm32/f0/syscfg.h index 7e796a05..fcfb74ab 100644 --- a/include/libopencm3/stm32/f0/syscfg.h +++ b/include/libopencm3/stm32/f0/syscfg.h @@ -91,7 +91,7 @@ /* SYSCFG_EXTICR Values -- --------------------------------------------------*/ -#define SYSCFG_EXTICR_SKIP 4 +#define SYSCFG_EXTICR_FIELDSIZE 4 #define SYSCFG_EXTICR_GPIOA 0 #define SYSCFG_EXTICR_GPIOB 1 #define SYSCFG_EXTICR_GPIOC 2 diff --git a/include/libopencm3/stm32/f1/gpio.h b/include/libopencm3/stm32/f1/gpio.h index 2de19ce9..e8b42506 100644 --- a/include/libopencm3/stm32/f1/gpio.h +++ b/include/libopencm3/stm32/f1/gpio.h @@ -933,10 +933,10 @@ Line Devices only /**@}*/ -/* --- AFIO_EXTICR1 values ------------------------------------------------- */ -/* --- AFIO_EXTICR2 values ------------------------------------------------- */ -/* --- AFIO_EXTICR3 values ------------------------------------------------- */ -/* --- AFIO_EXTICR4 values ------------------------------------------------- */ +/* --- AFIO_EXTICRx values ------------------------------------------------- */ + +/** EXTICR port selection bits */ +#define AFIO_EXTICR_FIELDSIZE 4 /** @defgroup afio_exti Alternate Function EXTI pin number @ingroup gpio_defines diff --git a/include/libopencm3/stm32/l0/syscfg.h b/include/libopencm3/stm32/l0/syscfg.h index 1ae0a947..767ddf44 100644 --- a/include/libopencm3/stm32/l0/syscfg.h +++ b/include/libopencm3/stm32/l0/syscfg.h @@ -111,6 +111,7 @@ /* SYSCFG_EXTICR Values -- --------------------------------------------------*/ +#define SYSCFG_EXTICR_FIELDSIZE 4 #define SYSCFG_EXTICR_GPIOA 0 #define SYSCFG_EXTICR_GPIOB 1 #define SYSCFG_EXTICR_GPIOC 2 diff --git a/include/libopencm3/stm32/l4/syscfg.h b/include/libopencm3/stm32/l4/syscfg.h index 934d7ac5..d11510b6 100644 --- a/include/libopencm3/stm32/l4/syscfg.h +++ b/include/libopencm3/stm32/l4/syscfg.h @@ -81,6 +81,7 @@ /* --- SYSCFG_EXTICR Values -------------------------------------------------*/ +#define SYSCFG_EXTICR_FIELDSIZE 4 #define SYSCFG_EXTICR_GPIOA 0 #define SYSCFG_EXTICR_GPIOB 1 #define SYSCFG_EXTICR_GPIOC 2