Skip to content

Commit a2b1c59

Browse files
gmarullcfriedt
authored andcommitted
boards: sf32lb52_devkit_lcd: define buttons and led
Define the two keys and LED available in the board. Also enable CONFIG_GPIO=y (considered minimal in Zephyr). Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 290ae4b commit a2b1c59

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

boards/sifli/sf32lb52_devkit_lcd/sf32lb52_devkit_lcd.dts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#include <sifli/sf32lb52x.dtsi>
99
#include <sifli/sf32lb52x-ram012.dtsi>
10+
#include <zephyr/dt-bindings/gpio/gpio.h>
11+
#include <zephyr/dt-bindings/input/input-event-codes.h>
1012

1113
#include "sf32lb52_devkit_lcd-pinctrl.dtsi"
1214

@@ -20,6 +22,37 @@
2022
zephyr,console = &usart1;
2123
zephyr,shell-uart = &usart1;
2224
};
25+
26+
buttons {
27+
compatible = "gpio-keys";
28+
29+
key1: key1 {
30+
label = "KEY1";
31+
gpios = <&gpioa_32_44 2 GPIO_ACTIVE_HIGH>;
32+
zephyr,code = <INPUT_KEY_1>;
33+
};
34+
35+
key2: key2 {
36+
label = "KEY2";
37+
gpios = <&gpioa_00_31 11 GPIO_ACTIVE_HIGH>;
38+
zephyr,code = <INPUT_KEY_2>;
39+
};
40+
};
41+
42+
leds {
43+
compatible = "gpio-leds";
44+
45+
led0: led0 {
46+
label = "LED0";
47+
gpios = <&gpioa_00_31 26 GPIO_ACTIVE_LOW>;
48+
};
49+
};
50+
51+
aliases {
52+
led0 = &led0;
53+
sw0 = &key1;
54+
sw1 = &key2;
55+
};
2356
};
2457

2558
&cpu0 {
@@ -43,6 +76,14 @@
4376
};
4477
};
4578

79+
&gpioa_00_31 {
80+
status = "okay";
81+
};
82+
83+
&gpioa_32_44 {
84+
status = "okay";
85+
};
86+
4687
&mpi2 {
4788
status = "okay";
4889

boards/sifli/sf32lb52_devkit_lcd/sf32lb52_devkit_lcd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ toolchain:
1111
- zephyr
1212
supported:
1313
- uart
14+
- gpio
1415
vendor: sifli

boards/sifli/sf32lb52_devkit_lcd/sf32lb52_devkit_lcd_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CONFIG_ARM_MPU=y
55
CONFIG_HW_STACK_PROTECTION=y
66

77
CONFIG_SERIAL=y
8+
CONFIG_GPIO=y
89

910
CONFIG_CONSOLE=y
1011
CONFIG_UART_CONSOLE=y

0 commit comments

Comments
 (0)