Skip to content

Commit d798ef9

Browse files
Surya-Tummavignesh-aerlync
authored andcommitted
boards: nxp: lpc845brk: add user button support
Add the user button (SW0) to the board device tree using the gpio-keys compatible. The button is connected to PIO0_4. Signed-off-by: Surya Prakash T <suryat@aerlync.com> Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
1 parent 7d03fd2 commit d798ef9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

boards/nxp/lpc845brk/lpc845brk.dts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <nxp/lpc/nxp_lpc845.dtsi>
1010
#include <zephyr/dt-bindings/pinctrl/lpc84x-pinctrl.h>
1111
#include <zephyr/dt-bindings/gpio/gpio.h>
12+
#include <zephyr/dt-bindings/input/input-event-codes.h>
1213

1314
/ {
1415
model = "NXP LPC845-BRK Board";
@@ -26,6 +27,7 @@
2627
led0 = &led0;
2728
led1 = &led1;
2829
led2 = &led2;
30+
sw0 = &user_btn;
2931
};
3032

3133
leds {
@@ -46,6 +48,16 @@
4648
label = "RGB Red Led";
4749
};
4850
};
51+
52+
buttons {
53+
compatible = "gpio-keys";
54+
55+
user_btn: button_0 {
56+
label = "User Button";
57+
gpios = <&gpio0 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
58+
zephyr,code = <INPUT_KEY_0>;
59+
};
60+
};
4961
};
5062

5163
&iap {

0 commit comments

Comments
 (0)