File tree Expand file tree Collapse file tree 6 files changed +69
-0
lines changed Expand file tree Collapse file tree 6 files changed +69
-0
lines changed Original file line number Diff line number Diff line change 18
18
bias-pull-up;
19
19
};
20
20
};
21
+
22
+ red_pwm_pinctrl: red_pwm_pinctrl {
23
+ group1 {
24
+ pinmux = <TIM2_CH1_PD4_0>;
25
+ output-high;
26
+ drive-push-pull;
27
+ slew-rate = "max-speed-10mhz";
28
+ };
29
+ };
21
30
};
Original file line number Diff line number Diff line change 7
7
8
8
#include <wch/ch32v0/ch32v003f4p.dtsi>
9
9
#include "ch32v003evt-pinctrl.dtsi"
10
+ #include <zephyr/dt-bindings/pwm/pwm.h>
10
11
11
12
/ {
12
13
model = "ch32v003evt";
34
35
};
35
36
};
36
37
38
+ pwmleds: pwmleds {
39
+ compatible = "pwm-leds";
40
+ status = "disabled";
41
+
42
+ red_pwm: red_pwm0 {
43
+ pwms = <&tim2 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
44
+ label = "Red LED";
45
+ };
46
+ };
47
+
37
48
aliases {
38
49
led0 = &red_led;
50
+ pwm-led0 = &red_pwm;
39
51
};
40
52
};
41
53
Original file line number Diff line number Diff line change
1
+ CONFIG_LOG_MODE_MINIMAL=y
2
+ CONFIG_CBPRINTF_NANO=y
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2025 Michael Hope <
[email protected] >
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ / {
8
+ leds {
9
+ status = "disabled";
10
+ };
11
+ };
12
+
13
+ &pwmleds {
14
+ status = "okay";
15
+ };
16
+
17
+ &tim2 {
18
+ status = "okay";
19
+ prescaler = <4800>;
20
+ pinctrl-0 = <&red_pwm_pinctrl>;
21
+ pinctrl-names = "default";
22
+ };
Original file line number Diff line number Diff line change
1
+ CONFIG_LOG_MODE_MINIMAL=y
2
+ CONFIG_CBPRINTF_NANO=y
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2025 Michael Hope <
[email protected] >
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ / {
8
+ leds {
9
+ status = "disabled";
10
+ };
11
+ };
12
+
13
+ &pwmleds {
14
+ status = "okay";
15
+ };
16
+
17
+ &tim2 {
18
+ status = "okay";
19
+ prescaler = <4800>;
20
+ pinctrl-0 = <&red_pwm_pinctrl>;
21
+ pinctrl-names = "default";
22
+ };
You can’t perform that action at this time.
0 commit comments