Skip to content

Commit ba00420

Browse files
VynDragonhenrikbrixandersen
authored andcommitted
boards: bflb: ai_wb2_12f: add buttons and leds
add the available button and leds Signed-off-by: Camille BAUD <[email protected]>
1 parent b640228 commit ba00420

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

boards/aithinker/ai_wb2_12f/ai_wb2_12f.dts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
/dts-v1/;
88

99
#include <bflb/bl602.dtsi>
10+
#include <zephyr/dt-bindings/gpio/gpio.h>
11+
#include <zephyr/dt-bindings/input/input-event-codes.h>
1012
#include "ai_wb2_12f-pinctrl.dtsi"
1113

1214
/ {
@@ -22,6 +24,38 @@
2224
zephyr,console = &uart0;
2325
zephyr,shell-uart = &uart0;
2426
};
27+
28+
aliases {
29+
led0 = &blue_led;
30+
sw0 = &button_0;
31+
};
32+
33+
leds {
34+
compatible = "gpio-leds";
35+
36+
blue_led: led_0 {
37+
gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
38+
label = "Blue - LED0";
39+
};
40+
41+
green_led: led_1 {
42+
gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
43+
label = "Green - LED1";
44+
};
45+
46+
red_led: led_2 {
47+
gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
48+
label = "Red - LED2";
49+
};
50+
};
51+
52+
buttons {
53+
compatible = "gpio-keys";
54+
button_0: sw0 {
55+
gpios = <&gpio0 8 (GPIO_ACTIVE_HIGH)>;
56+
zephyr,code = <INPUT_KEY_0>;
57+
};
58+
};
2559
};
2660

2761
&cpu0 {
@@ -63,3 +97,7 @@
6397
pinctrl-1 = <&uart0_sleep>;
6498
pinctrl-names = "default", "sleep";
6599
};
100+
101+
&gpio0 {
102+
status = "okay";
103+
};

0 commit comments

Comments
 (0)