From 5b31aca5e266309957487a0b199ffe4052cac8fb Mon Sep 17 00:00:00 2001 From: Mathieu Choplain Date: Thu, 9 Jan 2025 17:42:14 +0100 Subject: [PATCH] boards: st: nucleo_wb07cc: add PWM support and LED Add the PWM LED to Nucleo-WB07CC board and mark as compatible with PWM. Also mark counters as supported (but don't enable by default). Signed-off-by: Mathieu Choplain --- boards/st/nucleo_wb07cc/doc/index.rst | 2 ++ boards/st/nucleo_wb07cc/nucleo_wb07cc.dts | 19 +++++++++++++++++++ boards/st/nucleo_wb07cc/nucleo_wb07cc.yaml | 2 ++ 3 files changed, 23 insertions(+) diff --git a/boards/st/nucleo_wb07cc/doc/index.rst b/boards/st/nucleo_wb07cc/doc/index.rst index 69187a7b1e8..15a2cfc2fe4 100644 --- a/boards/st/nucleo_wb07cc/doc/index.rst +++ b/boards/st/nucleo_wb07cc/doc/index.rst @@ -52,6 +52,8 @@ The Zephyr ``nucleo_wb07cc`` board target supports the following hardware featur +-----------+------------+-------------------------------------+ | ADC | on-chip | adc | +-----------+------------+-------------------------------------+ +| TIMER | on-chip | counter, pwm | ++-----------+------------+-------------------------------------+ | RADIO | on-chip | Bluetooth Low Energy | +-----------+------------+-------------------------------------+ diff --git a/boards/st/nucleo_wb07cc/nucleo_wb07cc.dts b/boards/st/nucleo_wb07cc/nucleo_wb07cc.dts index 7e8cbf67fa6..4b53c858e92 100644 --- a/boards/st/nucleo_wb07cc/nucleo_wb07cc.dts +++ b/boards/st/nucleo_wb07cc/nucleo_wb07cc.dts @@ -39,6 +39,13 @@ }; }; + pwmleds: pwmleds { + compatible = "pwm-leds"; + pwm_red_led_1: pwm_red_led_1 { + pwms = <&pwm1 3 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; + gpio_keys { compatible = "gpio-keys"; user_button_1: button_0 { @@ -62,6 +69,7 @@ led0 = &blue_led_1; led1 = &green_led_1; led2 = &red_led_1; + pwm-led0 = &pwm_red_led_1; sw0 = &user_button_1; sw1 = &user_button_2; sw2 = &user_button_3; @@ -122,6 +130,17 @@ <&rcc STM32_SRC_SYSCLK SPI2_I2S2_SEL(1)>; }; +&timers1 { + status = "okay"; + st,prescaler = <10000>; + + pwm1: pwm { + status = "okay"; + pinctrl-0 = <&tim1_ch3_pb2>; + pinctrl-names = "default"; + }; +}; + &flash0 { partitions { compatible = "fixed-partitions"; diff --git a/boards/st/nucleo_wb07cc/nucleo_wb07cc.yaml b/boards/st/nucleo_wb07cc/nucleo_wb07cc.yaml index 9a263bce737..030cbf1ba02 100644 --- a/boards/st/nucleo_wb07cc/nucleo_wb07cc.yaml +++ b/boards/st/nucleo_wb07cc/nucleo_wb07cc.yaml @@ -12,9 +12,11 @@ supported: - adc - arduino_i2c - arduino_spi + - counter - dma - gpio - i2c + - pwm - spi - bluetooth vendor: st