Skip to content

Commit 2d78259

Browse files
committed
boards: cc3220sf_launchxl: Add dts support for led/buttons
Move LED/Button info from board.h to dts. Signed-off-by: Kumar Gala <[email protected]>
1 parent ac7da0b commit 2d78259

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed

boards/arm/cc3220sf_launchxl/board.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,4 @@
66
#ifndef __INC_BOARD_H
77
#define __INC_BOARD_H
88

9-
/* Push button switch 2 */
10-
#define SW2_GPIO_PIN 6 /* GPIO22/Pin15 */
11-
#define SW2_GPIO_NAME "GPIO_A2"
12-
13-
/* Push button switch 3 */
14-
#define SW3_GPIO_PIN 5 /* GPIO13/Pin4 */
15-
#define SW3_GPIO_NAME "GPIO_A1"
16-
17-
/* Push button switch 0: Map to SW2 so zephyr button example works */
18-
#define SW0_GPIO_PIN SW2_GPIO_PIN
19-
#define SW0_GPIO_NAME SW2_GPIO_NAME
20-
21-
/* Onboard GREEN LED */
22-
#define LED0_GPIO_PIN 3 /*GPIO11/Pin2 */
23-
#define LED0_GPIO_PORT "GPIO_A1"
24-
259
#endif /* __INC_BOARD_H */

boards/arm/cc3220sf_launchxl/cc3220sf_launchxl.dts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,47 @@
1010
uart-0 = &uart0;
1111
uart-1 = &uart1;
1212
i2c-0 = &i2c0;
13+
led0 = &led0;
14+
/* sw0/1 alias defined for compatibility with samples */
15+
sw0 = &sw2;
16+
sw1 = &sw3;
1317
};
1418

1519
chosen {
1620
zephyr,sram = &sram0;
1721
zephyr,flash = &flash1;
1822
zephyr,console = &uart0;
1923
};
24+
25+
leds {
26+
compatible = "gpio-leds";
27+
led0: led_0 {
28+
gpios = <&gpioa1 3 0>;
29+
label = "Green LED";
30+
};
31+
led1: led_1 {
32+
gpios = <&gpioa1 2 0>;
33+
label = "Yellow LED";
34+
};
35+
led2: led_2 {
36+
gpios = <&gpioa1 1 0>;
37+
label = "Red LED";
38+
};
39+
};
40+
41+
buttons {
42+
/* Push button 2 */
43+
compatible = "gpio-keys";
44+
sw2: button_0 {
45+
gpios = <&gpioa2 6 GPIO_INT_ACTIVE_LOW>;
46+
label = "Push button switch 2";
47+
};
48+
/* Push button 3 */
49+
sw3: button_1 {
50+
gpios = <&gpioa1 5 GPIO_INT_ACTIVE_LOW>;
51+
label = "Push button switch 3";
52+
};
53+
};
2054
};
2155

2256
&uart0 {

0 commit comments

Comments
 (0)