diff --git a/boards/arm/nucleo_h743zi/Kconfig.defconfig b/boards/arm/nucleo_h743zi/Kconfig.defconfig index ff33fbfa3de..cf19dc3b1a2 100644 --- a/boards/arm/nucleo_h743zi/Kconfig.defconfig +++ b/boards/arm/nucleo_h743zi/Kconfig.defconfig @@ -16,4 +16,8 @@ config I2C_1 default y depends on I2C +config PWM_STM32_12 + default y + depends on PWM + endif # BOARD_NUCLEO_H743ZI diff --git a/boards/arm/nucleo_h743zi/doc/index.rst b/boards/arm/nucleo_h743zi/doc/index.rst index 63741d21d27..9ca30060023 100644 --- a/boards/arm/nucleo_h743zi/doc/index.rst +++ b/boards/arm/nucleo_h743zi/doc/index.rst @@ -109,6 +109,8 @@ features: +-----------+------------+-------------------------------------+ | I2C | on-chip | i2c | +-----------+------------+-------------------------------------+ +| PWM | on-chip | pwm | ++-----------+------------+-------------------------------------+ Other hardware features are not yet supported on this Zephyr port. diff --git a/boards/arm/nucleo_h743zi/nucleo_h743zi.dts b/boards/arm/nucleo_h743zi/nucleo_h743zi.dts index 3908509e27b..2158e5983ec 100644 --- a/boards/arm/nucleo_h743zi/nucleo_h743zi.dts +++ b/boards/arm/nucleo_h743zi/nucleo_h743zi.dts @@ -30,9 +30,13 @@ gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>; label = "User LD2"; }; - red_led: led_2 { - gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>; - label = "User LD3"; + }; + + pwmleds { + compatible = "pwm-leds"; + + red_pwm_led: red_pwm_led { + pwms = <&{/soc/timers@40001800/pwm} 1 4>; }; }; @@ -47,7 +51,7 @@ aliases { led0 = &green_led; led1 = &blue_led; - led2 = &red_led; + pwm-led0 = &red_pwm_led; sw0 = &user_button; }; }; @@ -65,3 +69,11 @@ status = "okay"; clock-frequency = ; }; + +&timers12 { + status = "okay"; + + pwm { + status = "okay"; + }; +}; diff --git a/boards/arm/nucleo_h743zi/nucleo_h743zi.yaml b/boards/arm/nucleo_h743zi/nucleo_h743zi.yaml index 9b7af1655ef..6e289a86e0c 100644 --- a/boards/arm/nucleo_h743zi/nucleo_h743zi.yaml +++ b/boards/arm/nucleo_h743zi/nucleo_h743zi.yaml @@ -15,3 +15,4 @@ supported: - gpio - counter - i2c + - pwm diff --git a/boards/arm/nucleo_h743zi/pinmux.c b/boards/arm/nucleo_h743zi/pinmux.c index 41f7b63d7f2..93750a41b5a 100644 --- a/boards/arm/nucleo_h743zi/pinmux.c +++ b/boards/arm/nucleo_h743zi/pinmux.c @@ -22,6 +22,9 @@ static const struct pin_config pinconf[] = { { STM32_PIN_PB8, STM32H7_PINMUX_FUNC_PB8_I2C1_SCL }, { STM32_PIN_PB9, STM32H7_PINMUX_FUNC_PB9_I2C1_SDA }, #endif /* CONFIG_I2C_1 */ +#ifdef CONFIG_PWM_STM32_12 + { STM32_PIN_PB14, STM32H7_PINMUX_FUNC_PB14_PWM12_CH1 } +#endif /* CONFIG_PWM_STM32_12 */ }; static int pinmux_stm32_init(struct device *port) diff --git a/samples/basic/blink_led/README.rst b/samples/basic/blink_led/README.rst index a9b7a6f4f4c..71ce8cc92e9 100644 --- a/samples/basic/blink_led/README.rst +++ b/samples/basic/blink_led/README.rst @@ -37,6 +37,11 @@ Nucleo_L496ZG No special board setup is necessary because there are three on-board LEDs (red, green, blue) connected to the Nucleo's PWM. +Nucleo_H743ZI +============= +No special board setup is necessary because the on-board red LED is connected +to PWM output 12 (channel 1). + Hexiwear K64 ============ No special board setup is necessary because there is an on-board RGB LED diff --git a/samples/basic/fade_led/README.rst b/samples/basic/fade_led/README.rst index 0f5fed32ada..c321fc2b527 100644 --- a/samples/basic/fade_led/README.rst +++ b/samples/basic/fade_led/README.rst @@ -30,6 +30,11 @@ Nucleo_L496ZG No special board setup is necessary because there are three on-board LEDs (red, green, blue) connected to the Nucleo's PWM. +Nucleo_H743ZI +============= +No special board setup is necessary because the on-board red LED is connected +to PWM output 12 (channel 1). + Hexiwear K64 ============ No special board setup is necessary because there is an on-board RGB LED