From 9f6fdae4306473eeb0da4de2218c197ae8e574b4 Mon Sep 17 00:00:00 2001 From: Neil Chen Date: Wed, 4 Dec 2024 11:34:55 +0800 Subject: [PATCH] boards: nxp: frdm_mcxa156: Support pwm for NXP frdm_mcxa156 board Support pwm for NXP frdm_mcxa156 board. Test with tests/drivers/pwm/pwm_api. Signed-off-by: Neil Chen --- boards/nxp/frdm_mcxa156/doc/index.rst | 2 ++ boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi | 8 ++++++++ boards/nxp/frdm_mcxa156/frdm_mcxa156.dts | 7 +++++++ boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml | 1 + 4 files changed, 18 insertions(+) diff --git a/boards/nxp/frdm_mcxa156/doc/index.rst b/boards/nxp/frdm_mcxa156/doc/index.rst index 4094a7904a4..75d115fc627 100644 --- a/boards/nxp/frdm_mcxa156/doc/index.rst +++ b/boards/nxp/frdm_mcxa156/doc/index.rst @@ -56,6 +56,8 @@ The FRDM-MCXA156 board configuration supports the following hardware features: +-----------+------------+-------------------------------------+ | DAC | on-chip | dac | +-----------+------------+-------------------------------------+ +| PWM | on-chip | pwm | ++-----------+------------+-------------------------------------+ Targets available ================== diff --git a/boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi b/boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi index d99fc81ddb4..73a8a4a79cb 100644 --- a/boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi +++ b/boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi @@ -23,4 +23,12 @@ slew-rate = "fast"; }; }; + pinmux_flexpwm0_pwm0: pinmux_flexpwm0_pwm0 { + group0 { + pinmux = , + ; + slew-rate = "fast"; + drive-strength = "low"; + }; + }; }; diff --git a/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts b/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts index 10b1a9e7dc8..9407ba1a235 100644 --- a/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts +++ b/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts @@ -20,6 +20,7 @@ led2 = &red_led; sw0 = &user_button_2; sw1 = &user_button_3; + pwm-0 = &flexpwm0_pwm0; }; chosen { @@ -94,3 +95,9 @@ pinctrl-0 = <&pinmux_dac0>; pinctrl-names = "default"; }; + +&flexpwm0_pwm0 { + status = "okay"; + pinctrl-0 = <&pinmux_flexpwm0_pwm0>; + pinctrl-names = "default"; +}; diff --git a/boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml b/boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml index e90d80dadd2..abad7e82254 100644 --- a/boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml +++ b/boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml @@ -18,4 +18,5 @@ supported: - flash - gpio - dac + - pwm vendor: nxp