From 68527f5506c529d42209319e0c3bd4ce14191e41 Mon Sep 17 00:00:00 2001 From: Caldeira Quentin Date: Thu, 30 May 2024 09:37:19 +0200 Subject: [PATCH] boards: stm32wb5mmg_dk: add button support This patch add buttons support for the two user buttons Signed-off-by: Caldeira Quentin --- boards/st/stm32wb5mm_dk/doc/stm32wb5mm_dk.rst | 4 ++++ boards/st/stm32wb5mm_dk/stm32wb5mm_dk.dts | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/boards/st/stm32wb5mm_dk/doc/stm32wb5mm_dk.rst b/boards/st/stm32wb5mm_dk/doc/stm32wb5mm_dk.rst index 51bde0110c5..bc7218a4d94 100644 --- a/boards/st/stm32wb5mm_dk/doc/stm32wb5mm_dk.rst +++ b/boards/st/stm32wb5mm_dk/doc/stm32wb5mm_dk.rst @@ -178,6 +178,10 @@ simultaneously. The selection is done by JP4 and JP5 jumpers. To use the RGB LED, JP5 must be ON and JP4 OFF. In this configuration, GPIO_SELECT2 (PH1) is the chip select for this RGB device on SPI1. +Buttons +------- +STM32WB5MM-DK has two user buttons. The first button is mapped to PC12, +and the second to PC13. They have the aliases sw0 and sw1 respectively. Programming and Debugging ************************* diff --git a/boards/st/stm32wb5mm_dk/stm32wb5mm_dk.dts b/boards/st/stm32wb5mm_dk/stm32wb5mm_dk.dts index 6e48823ae24..60fb751f300 100644 --- a/boards/st/stm32wb5mm_dk/stm32wb5mm_dk.dts +++ b/boards/st/stm32wb5mm_dk/stm32wb5mm_dk.dts @@ -34,12 +34,28 @@ status = "disabled"; }; + buttons { + compatible = "gpio-keys"; + button0: button_0 { + gpios = <&gpioc 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 1"; + zephyr,code = ; + }; + button1: button_1 { + gpios = <&gpioc 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 2"; + zephyr,code = ; + }; + }; + aliases { watchdog0 = &iwdg; die-temp0 = &die_temp; volt-sensor0 = &vref; volt-sensor1 = &vbat; led-strip = &rgb_led_strip; + sw0 = &button0; + sw1 = &button1; }; };