Skip to content

Commit a40e900

Browse files
yishai1999nashif
authored andcommitted
boards: stm32f4_disco: Add pwm leds
Add four PWM leds for stm32f4_disco in order to run the samples/basic/fade_led application. Signed-off-by: Yishai Jaffe <[email protected]>
1 parent 918cbc5 commit a40e900

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

boards/st/stm32f4_disco/stm32f4_disco.dts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,26 @@
5151
};
5252
};
5353

54+
pwmleds: pwmleds {
55+
compatible = "pwm-leds";
56+
57+
orange_pwm_led: orange_pwm_led {
58+
pwms = <&pwm4 2 PWM_USEC(100) PWM_POLARITY_NORMAL>;
59+
};
60+
61+
green_pwm_led: green_pwm_led {
62+
pwms = <&pwm4 1 PWM_USEC(100) PWM_POLARITY_NORMAL>;
63+
};
64+
65+
red_pwm_led: red_pwm_led {
66+
pwms = <&pwm4 3 PWM_USEC(100) PWM_POLARITY_NORMAL>;
67+
};
68+
69+
blue_pwm_led: blue_pwm_led {
70+
pwms = <&pwm4 4 PWM_USEC(100) PWM_POLARITY_NORMAL>;
71+
};
72+
};
73+
5474
aliases {
5575
led0 = &green_led_4;
5676
led1 = &orange_led_3;
@@ -110,6 +130,16 @@
110130
};
111131
};
112132

133+
&timers4 {
134+
status = "okay";
135+
136+
pwm4: pwm {
137+
status = "okay";
138+
pinctrl-0 = <&tim4_ch1_pd12 &tim4_ch2_pd13 &tim4_ch3_pd14 &tim4_ch4_pd15>;
139+
pinctrl-names = "default";
140+
};
141+
};
142+
113143
&rtc {
114144
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
115145
<&rcc STM32_SRC_LSI RTC_SEL(2)>;

0 commit comments

Comments
 (0)