From 4f0fd9cf95d748b095b8fa314185d2c8b422a96f Mon Sep 17 00:00:00 2001 From: Gilles DOFFE Date: Mon, 3 Aug 2020 00:29:59 +0200 Subject: [PATCH] cpu/stm32: add GPIO_PIN macro for stm32mp1 family As stm32mp1 family accesses gpio pins with a different offset than other stm32, create a specific macro. Signed-off-by: Gilles DOFFE --- cpu/stm32/include/periph_cpu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/stm32/include/periph_cpu.h b/cpu/stm32/include/periph_cpu.h index 3f211454a0..e1fbf50f9d 100644 --- a/cpu/stm32/include/periph_cpu.h +++ b/cpu/stm32/include/periph_cpu.h @@ -221,7 +221,11 @@ typedef uint32_t gpio_t; /** * @brief Define a CPU specific GPIO pin generator macro */ +#if defined(CPU_FAM_STM32MP1) +#define GPIO_PIN(x, y) ((GPIOA_BASE + (x << 12)) | y) +#else #define GPIO_PIN(x, y) ((GPIOA_BASE + (x << 10)) | y) +#endif /** * @brief Available GPIO ports