Skip to content

Commit ba374d7

Browse files
committed
boards: ti: lp_em_cc2340r5: Add leds and keys support
Add support for LEDs and buttons. Signed-off-by: Lars Thalian Morstad <[email protected]> Signed-off-by: Vebjorn Myklebust <[email protected]> Signed-off-by: Stoyan Bogdanov <[email protected]> Signed-off-by: Julien Panis <[email protected]>
1 parent 8205598 commit ba374d7

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

boards/ti/lp_em_cc2340r5/lp_em_cc2340r5.dts

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

1010
#include <ti/cc2340r5.dtsi>
11+
#include "boosterpack_connector.dtsi"
12+
#include <zephyr/dt-bindings/gpio/gpio.h>
13+
#include <zephyr/dt-bindings/input/input-event-codes.h>
14+
15+
#define BTN_GPIO_FLAGS (GPIO_ACTIVE_LOW | GPIO_PULL_UP)
1116

1217
/ {
1318
model = "LP_EM_CC2340R5";
@@ -17,6 +22,39 @@
1722
zephyr,sram = &sram0;
1823
zephyr,flash = &flash0;
1924
};
25+
26+
aliases {
27+
led0 = &led0;
28+
led1 = &led1;
29+
sw0 = &btn0;
30+
sw1 = &btn1;
31+
};
32+
33+
leds {
34+
compatible = "gpio-leds";
35+
led0: led_0 {
36+
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
37+
label = "Green LED";
38+
};
39+
led1: led_1 {
40+
gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
41+
label = "Red LED";
42+
};
43+
};
44+
45+
keys {
46+
compatible = "gpio-keys";
47+
btn0: btn_0 {
48+
gpios = <&gpio0 10 BTN_GPIO_FLAGS>;
49+
label = "Button 1";
50+
zephyr,code = <INPUT_KEY_0>;
51+
};
52+
btn1: btn_1 {
53+
gpios = <&gpio0 9 BTN_GPIO_FLAGS>;
54+
label = "Button 2";
55+
zephyr,code = <INPUT_KEY_1>;
56+
};
57+
};
2058
};
2159

2260
&cpu0 {

0 commit comments

Comments
 (0)