Skip to content

Commit c9e697d

Browse files
silabs-bozontdanieldegrasse
authored andcommitted
boards: sparkfun: add PWM support for the Thing Plus Matter
The onboard LED is now controllable via PWM. Signed-off-by: Tamas Jozsi <tamas.jozsi@silabs.com>
1 parent 67e3480 commit c9e697d

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@
2929
};
3030
};
3131

32+
timer0_default: timer0_default {
33+
group0 {
34+
pins = <TIMER0_CC0_PA8>;
35+
drive-push-pull;
36+
output-high;
37+
};
38+
};
39+
3240
/* configuration for uart0 device, default state */
3341
usart0_default: usart0_default {
3442
group0 {

boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.dts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/*
22
* Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
33
* Copyright (c) 2020 TriaGnoSys GmbH
4+
* Copyright (c) 2025 Silicon Laboratories Inc.
45
*
56
* SPDX-License-Identifier: Apache-2.0
67
*/
78

89
/dts-v1/;
910
#include <silabs/xg24/mgm240pb32vna.dtsi>
11+
#include <zephyr/dt-bindings/pwm/pwm.h>
1012
#include "sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi"
1113
#include <zephyr/dt-bindings/input/input-event-codes.h>
1214
#include <zephyr/dt-bindings/regulator/silabs_dcdc.h>
@@ -26,6 +28,7 @@
2628

2729
aliases {
2830
led0 = &blue_led;
31+
pwm-led0 = &blue_pwm_led;
2932
spi0 = &eusart1;
3033
watchdog0 = &wdog0;
3134
};
@@ -38,12 +41,31 @@
3841
};
3942
};
4043

44+
pwmleds {
45+
compatible = "pwm-leds";
46+
47+
blue_pwm_led: pwm_led_0 {
48+
pwms = <&timer0_pwm 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
49+
label = "blue";
50+
};
51+
};
52+
4153
wake_up_trigger: gpio-wake-up {
4254
compatible = "silabs,gecko-wake-up-trigger";
4355
gpios = <&gpioa 5 GPIO_ACTIVE_LOW>;
4456
};
4557
};
4658

59+
&timer0 {
60+
status = "okay";
61+
62+
timer0_pwm: pwm {
63+
pinctrl-0 = <&timer0_default>;
64+
pinctrl-names = "default";
65+
status = "okay";
66+
};
67+
};
68+
4769
&cpu0 {
4870
clock-frequency = <78000000>;
4971
};

0 commit comments

Comments
 (0)