Skip to content

Commit f0cc39c

Browse files
bogdanovskartben
authored andcommitted
boards: ti: lp_em_cc2340r5: Add leds and keys support
Add support for LEDs and buttons. Signed-off-by: Lars Thalian Morstad <l-morstad@ti.com> Signed-off-by: Vebjorn Myklebust <v.myklebust@ti.com> Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com> Signed-off-by: Julien Panis <jpanis@baylibre.com>
1 parent 0eba0fc commit f0cc39c

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

boards/ti/lp_em_cc2340r5/lp_em_cc2340r5.dts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
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>
1114

1215
/ {
1316
model = "LP_EM_CC2340R5";
@@ -18,6 +21,43 @@
1821
zephyr,flash = &flash0;
1922
zephyr,code-partition = &slot0_partition;
2023
};
24+
25+
aliases {
26+
led0 = &led0;
27+
led1 = &led1;
28+
sw0 = &btn0;
29+
sw1 = &btn1;
30+
};
31+
32+
leds {
33+
compatible = "gpio-leds";
34+
35+
led0: led_0 {
36+
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
37+
label = "Green LED";
38+
};
39+
40+
led1: led_1 {
41+
gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
42+
label = "Red LED";
43+
};
44+
};
45+
46+
keys {
47+
compatible = "gpio-keys";
48+
49+
btn0: btn_0 {
50+
gpios = <&gpio0 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
51+
label = "Button 1";
52+
zephyr,code = <INPUT_KEY_0>;
53+
};
54+
55+
btn1: btn_1 {
56+
gpios = <&gpio0 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
57+
label = "Button 2";
58+
zephyr,code = <INPUT_KEY_1>;
59+
};
60+
};
2161
};
2262

2363
&gpio0 {

0 commit comments

Comments
 (0)