From c7a17d81747def9ceb66f05cbb2fa08dc9c91b6b Mon Sep 17 00:00:00 2001 From: cepetr Date: Wed, 20 Nov 2024 16:24:20 +0100 Subject: [PATCH] TEMP - add power button (disc2) --- core/embed/models/D002/boards/stm32u5g9j-dk.h | 9 +++++++++ core/site_scons/models/D002/discovery2.py | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/core/embed/models/D002/boards/stm32u5g9j-dk.h b/core/embed/models/D002/boards/stm32u5g9j-dk.h index 26587d162d..a7e5befced 100644 --- a/core/embed/models/D002/boards/stm32u5g9j-dk.h +++ b/core/embed/models/D002/boards/stm32u5g9j-dk.h @@ -5,6 +5,15 @@ #define DISPLAY_COLOR_MODE DMA2D_OUTPUT_ARGB8888 +#define BTN_POWER_PIN GPIO_PIN_13 +#define BTN_POWER_PORT GPIOC +#define BTN_POWER_CLK_ENA __HAL_RCC_GPIOC_CLK_ENABLE +#define BTN_EXTI_INTERRUPT_GPIOSEL EXTI_GPIOC +#define BTN_EXTI_INTERRUPT_LINE EXTI_LINE_13 +#define BTN_EXTI_INTERRUPT_PIN GPIO_PIN_13 +#define BTN_EXTI_INTERRUPT_NUM EXTI13_IRQn +#define BTN_EXTI_INTERRUPT_HANDLER EXTI13_IRQHandler + #define I2C_COUNT 2 #define I2C_INSTANCE_0 I2C5 #define I2C_INSTANCE_0_CLK_EN __HAL_RCC_I2C5_CLK_ENABLE diff --git a/core/site_scons/models/D002/discovery2.py b/core/site_scons/models/D002/discovery2.py index 496296144b..e23511c914 100644 --- a/core/site_scons/models/D002/discovery2.py +++ b/core/site_scons/models/D002/discovery2.py @@ -51,6 +51,12 @@ def configure( defines += ["USE_TOUCH=1"] defines += ["USE_I2C=1"] + sources += ["embed/io/button/stm32/button.c"] + paths += ["embed/io/button/inc"] + features_available.append("button") + defines += ["USE_BUTTON=1"] + + if "usb" in features_wanted: sources += [ "embed/io/usb/stm32/usb_class_hid.c",