Skip to content

Commit a317f19

Browse files
loopjMaureenHelm
authored andcommitted
boards: silabs: xg22_ek2710a: add support for pwm-leds
Add support for pwm-leds on xG22-EK2710A boards. Signed-off-by: James Smith <[email protected]>
1 parent 5e75627 commit a317f19

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a-pinctrl.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
};
3232
};
3333

34+
timer0_default: timer0_default {
35+
group0 {
36+
pins = <TIMER0_CC0_PA4>;
37+
drive-push-pull;
38+
output-high;
39+
};
40+
};
41+
3442
usart1_default: usart1_default {
3543
group0 {
3644
pins = <USART1_TX_PA5>;

boards/silabs/dev_kits/xg22_ek2710a/xg22_ek2710a.dts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <silabs/xg22/efr32mg22e224f512im40.dtsi>
99
#include <zephyr/dt-bindings/input/input-event-codes.h>
1010
#include <zephyr/dt-bindings/regulator/silabs_dcdc.h>
11+
#include <zephyr/dt-bindings/pwm/pwm.h>
1112
#include "xg22_ek2710a-pinctrl.dtsi"
1213

1314
/ {
@@ -26,6 +27,7 @@
2627

2728
aliases {
2829
led0 = &led0;
30+
pwm-led0 = &pwm_led0;
2931
sw0 = &button0;
3032
watchdog0 = &wdog0;
3133

@@ -42,6 +44,13 @@
4244
};
4345
};
4446

47+
pwmleds {
48+
compatible = "pwm-leds";
49+
pwm_led0: pwm_led_0 {
50+
pwms = <&timer0_pwm 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
51+
};
52+
};
53+
4554
buttons {
4655
compatible = "gpio-keys";
4756

@@ -52,6 +61,16 @@
5261
};
5362
};
5463

64+
&timer0 {
65+
status = "okay";
66+
67+
timer0_pwm: pwm {
68+
pinctrl-0 = <&timer0_default>;
69+
pinctrl-names = "default";
70+
status = "okay";
71+
};
72+
};
73+
5574
&cpu0 {
5675
clock-frequency = <76800000>;
5776
};

0 commit comments

Comments
 (0)