Skip to content

Commit 60a70fd

Browse files
decsnyhenrikbrixandersen
authored andcommitted
boards: frdm_mcxw71: Enable TPM and pwm_leds
Enable TPM0 on FRDM_MCXW71 which is connected to an RGB LED. Signed-off-by: Declan Snyder <[email protected]>
1 parent b74a7c4 commit 60a70fd

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

boards/nxp/frdm_mcxw71/frdm_mcxw71-pinctrl.dtsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,14 @@
1313
slew-rate = "fast";
1414
};
1515
};
16+
17+
pinmux_tpm0: pinmux_tpm0 {
18+
group0 {
19+
pinmux = <TPM0_CH0_PTA21>,
20+
<TPM0_CH1_PTA20>,
21+
<TPM0_CH2_PTA19>;
22+
drive-strength = "low";
23+
slew-rate = "fast";
24+
};
25+
};
1626
};

boards/nxp/frdm_mcxw71/frdm_mcxw71.dts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
aliases {
1515
led0 = &blue_led;
16+
blue-pwm-led = &blue_pwm_led;
17+
green-pwm-led = &green_pwm_led;
18+
red-pwm-led = &red_pwm_led;
1619
};
1720

1821
chosen {
@@ -30,6 +33,19 @@
3033
gpios = <&gpioc 1 GPIO_ACTIVE_LOW>;
3134
};
3235
};
36+
37+
pwmleds {
38+
compatible = "pwm-leds";
39+
blue_pwm_led: pwm_led_0 {
40+
pwms = <&tpm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
41+
};
42+
green_pwm_led: pwm_led_1 {
43+
pwms = <&tpm0 2 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
44+
};
45+
red_pwm_led: pwm_led_2 {
46+
pwms = <&tpm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
47+
};
48+
};
3349
};
3450

3551
&gpioc {
@@ -65,3 +81,9 @@
6581
&fmu {
6682
status = "okay";
6783
};
84+
85+
&tpm0 {
86+
status = "okay";
87+
pinctrl-0 = <&pinmux_tpm0>;
88+
pinctrl-names = "default";
89+
};

0 commit comments

Comments
 (0)