From c9e697de5f297584c9ba65b4d8eb37181ff601b1 Mon Sep 17 00:00:00 2001 From: Tamas Jozsi Date: Wed, 25 Jun 2025 14:50:02 +0200 Subject: [PATCH] boards: sparkfun: add PWM support for the Thing Plus Matter The onboard LED is now controllable via PWM. Signed-off-by: Tamas Jozsi --- ...fun_thing_plus_matter_mgm240p-pinctrl.dtsi | 8 +++++++ .../sparkfun_thing_plus_matter_mgm240p.dts | 22 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi index 2eccbc690d5..52f0f2d8a17 100644 --- a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi +++ b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi @@ -29,6 +29,14 @@ }; }; + timer0_default: timer0_default { + group0 { + pins = ; + drive-push-pull; + output-high; + }; + }; + /* configuration for uart0 device, default state */ usart0_default: usart0_default { group0 { diff --git a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.dts b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.dts index 4866552c585..084a2d344b6 100644 --- a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.dts +++ b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.dts @@ -1,12 +1,14 @@ /* * Copyright (c) 2024 Daikin Comfort Technologies North America, Inc. * Copyright (c) 2020 TriaGnoSys GmbH + * Copyright (c) 2025 Silicon Laboratories Inc. * * SPDX-License-Identifier: Apache-2.0 */ /dts-v1/; #include +#include #include "sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi" #include #include @@ -26,6 +28,7 @@ aliases { led0 = &blue_led; + pwm-led0 = &blue_pwm_led; spi0 = &eusart1; watchdog0 = &wdog0; }; @@ -38,12 +41,31 @@ }; }; + pwmleds { + compatible = "pwm-leds"; + + blue_pwm_led: pwm_led_0 { + pwms = <&timer0_pwm 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "blue"; + }; + }; + wake_up_trigger: gpio-wake-up { compatible = "silabs,gecko-wake-up-trigger"; gpios = <&gpioa 5 GPIO_ACTIVE_LOW>; }; }; +&timer0 { + status = "okay"; + + timer0_pwm: pwm { + pinctrl-0 = <&timer0_default>; + pinctrl-names = "default"; + status = "okay"; + }; +}; + &cpu0 { clock-frequency = <78000000>; };