Skip to content

Commit 35c08ea

Browse files
pepe2kcarlescufi
authored andcommitted
boards: st: nucleo_wba55cg: define all LEDs and buttons
This board includes three gpio-connected LEDs and push-buttons. Include all missing defines in board's DTS and while at it, fix existing button definition (missing pull-up enable) and align node names with other boards (e.g. 'nucleo_wb55rg'). Provided changes were tested on real board with 'blinky' and 'button' samples. Additionally, duplicated LED nodes no longer required were removed from overlay file for this board, in 'suspend_to_ram' sample. Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
1 parent 19df415 commit 35c08ea

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

boards/st/nucleo_wba55cg/nucleo_wba55cg.dts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,46 @@
2929

3030
leds: leds {
3131
compatible = "gpio-leds";
32-
blue_led_1: led_1 {
32+
blue_led_1: led_0 {
3333
gpios = <&gpiob 4 GPIO_ACTIVE_LOW>;
3434
label = "User LD1";
3535
};
36+
green_led_2: led_1 {
37+
gpios = <&gpioa 9 GPIO_ACTIVE_LOW>;
38+
label = "User LD2";
39+
};
40+
red_led_3: led_2 {
41+
gpios = <&gpiob 8 GPIO_ACTIVE_LOW>;
42+
label = "User LD3";
43+
};
3644
};
3745

3846
gpio_keys {
3947
compatible = "gpio-keys";
40-
user_button: button {
41-
label = "User";
42-
gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
48+
user_button_1: button_0 {
49+
label = "User B1";
50+
gpios = <&gpioc 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
4351
zephyr,code = <INPUT_KEY_0>;
4452
};
53+
user_button_2: button_1 {
54+
label = "User B2";
55+
gpios = <&gpiob 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
56+
zephyr,code = <INPUT_KEY_1>;
57+
};
58+
user_button_3: button_2 {
59+
label = "User B3";
60+
gpios = <&gpiob 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
61+
zephyr,code = <INPUT_KEY_2>;
62+
};
4563
};
4664

4765
aliases {
4866
led0 = &blue_led_1;
49-
sw0 = &user_button;
67+
led1 = &green_led_2;
68+
led2 = &red_led_3;
69+
sw0 = &user_button_1;
70+
sw1 = &user_button_2;
71+
sw2 = &user_button_3;
5072
};
5173
};
5274

samples/boards/stm32/power_mgmt/suspend_to_ram/boards/nucleo_wba55cg.overlay

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@
3131
/* adjust channel number according to pinmux in board.dts */
3232
io-channels = <&adc4 8>;
3333
};
34-
35-
leds: leds {
36-
compatible = "gpio-leds";
37-
red_led_3: led_3 {
38-
gpios = <&gpiob 8 GPIO_ACTIVE_LOW>;
39-
label = "User LD2";
40-
};
41-
};
42-
43-
aliases {
44-
led2 = &red_led_3;
45-
};
4634
};
4735

4836
&lptim1 {

0 commit comments

Comments
 (0)