Browse Source

boards: seeed: add PWM support for the XIAO MG24

The onboard LED is now controllable via PWM.

Signed-off-by: Tamas Jozsi <tamas.jozsi@silabs.com>
pull/92320/head
Tamas Jozsi 2 weeks ago committed by Daniel DeGrasse
parent
commit
76f107b795
  1. 9
      boards/seeed/xiao_mg24/xiao_mg24-pinctrl.dtsi
  2. 22
      boards/seeed/xiao_mg24/xiao_mg24.dts

9
boards/seeed/xiao_mg24/xiao_mg24-pinctrl.dtsi

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
/*
* Copyright (c) 2025 Pete Johanson
* Copyright (c) 2025 Silicon Laboratories Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -56,4 +57,12 @@ @@ -56,4 +57,12 @@
bias-pull-up;
};
};
timer0_default: timer0_default {
group0 {
pins = <TIMER0_CC0_PA7>;
drive-push-pull;
output-high;
};
};
};

22
boards/seeed/xiao_mg24/xiao_mg24.dts

@ -1,11 +1,13 @@ @@ -1,11 +1,13 @@
/*
* Copyright (c) 2025 Pete Johanson
* Copyright (c) 2025 Silicon Laboratories Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <silabs/xg24/efr32mg24b220f1536im48.dtsi>
#include <zephyr/dt-bindings/pwm/pwm.h>
#include "xiao_mg24-pinctrl.dtsi"
#include "seeed_xiao_connector.dtsi"
@ -26,6 +28,7 @@ @@ -26,6 +28,7 @@
/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
pwm-led0 = &pwm_led0;
watchdog0 = &wdog0;
};
@ -37,6 +40,25 @@ @@ -37,6 +40,25 @@
label = "LED 0";
};
};
pwmleds {
compatible = "pwm-leds";
pwm_led0: pwm_led_0 {
pwms = <&timer0_pwm 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
label = "PWM LED 0";
};
};
};
&timer0 {
status = "okay";
timer0_pwm: pwm {
pinctrl-0 = <&timer0_default>;
pinctrl-names = "default";
status = "okay";
};
};
&cpu0 {

Loading…
Cancel
Save