boards: stm32wb5mmg_dk: add button support

This patch add buttons support for the two user buttons

Signed-off-by: Caldeira Quentin <QuentinCaldeira@eaton.com>
This commit is contained in:
Caldeira Quentin 2024-05-30 09:37:19 +02:00 committed by Henrik Brix Andersen
commit 68527f5506
2 changed files with 20 additions and 0 deletions

View file

@ -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
*************************

View file

@ -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 = <INPUT_KEY_0>;
};
button1: button_1 {
gpios = <&gpioc 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "Push button 2";
zephyr,code = <INPUT_KEY_1>;
};
};
aliases {
watchdog0 = &iwdg;
die-temp0 = &die_temp;
volt-sensor0 = &vref;
volt-sensor1 = &vbat;
led-strip = &rgb_led_strip;
sw0 = &button0;
sw1 = &button1;
};
};