Skip to content

Commit 6559af8

Browse files
bogdanovsnashif
authored andcommitted
boards: ti: lp_em_2340r5: Add PWM led support
Add default pwm leds: - pwm_led0 - red led on the board - pwm_led1 - green led on the board Signed-off-by: Stoyan Bogdanov <[email protected]>
1 parent 285453a commit 6559af8

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

boards/ti/lp_em_cc2340r5/lp_em_cc2340r5.dts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "boosterpack_connector.dtsi"
1212
#include "lp_em_cc2340r5-pinctrl.dtsi"
1313
#include <zephyr/dt-bindings/gpio/gpio.h>
14+
#include <zephyr/dt-bindings/pwm/pwm.h>
1415
#include <zephyr/dt-bindings/input/input-event-codes.h>
1516

1617
/ {
@@ -31,6 +32,8 @@
3132
sw0 = &btn0;
3233
sw1 = &btn1;
3334
watchdog0 = &wdt0;
35+
pwm-led0 = &pwm_green;
36+
pwm-led1 = &pwm_red;
3437
};
3538

3639
leds {
@@ -47,6 +50,20 @@
4750
};
4851
};
4952

53+
pwmleds {
54+
compatible = "pwm-leds";
55+
56+
pwm_green: pwm_led_0 {
57+
pwms = <&pwm6 0 1000 PWM_POLARITY_NORMAL>;
58+
label = "Green PWM LED";
59+
};
60+
61+
pwm_red: pwm_led_1 {
62+
pwms = <&pwm5 0 1000 PWM_POLARITY_NORMAL>;
63+
label = "Red PWM LED";
64+
};
65+
};
66+
5067
keys {
5168
compatible = "gpio-keys";
5269

@@ -106,3 +123,25 @@
106123
&adc0_ch8>;
107124
pinctrl-names = "default";
108125
};
126+
127+
&lgpt1 {
128+
clk-prescale = <0>;
129+
status = "okay";
130+
};
131+
132+
&lgpt2 {
133+
clk-prescale = <0>;
134+
status = "okay";
135+
};
136+
137+
&pwm5 {
138+
pinctrl-0 = <&pwm5_default>;
139+
pinctrl-names = "default";
140+
status = "okay";
141+
};
142+
143+
&pwm6 {
144+
pinctrl-0 = <&pwm6_default>;
145+
pinctrl-names = "default";
146+
status = "okay";
147+
};

0 commit comments

Comments
 (0)