Skip to content

Commit

Permalink
boards: st: nucleo_wb05kz: add PWM support and LED
Browse files Browse the repository at this point in the history
Add the PWM LED to Nucleo-WB05KZ board and mark as compatible with PWM.
Also mark counters as supported (but don't enable by default).

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
  • Loading branch information
mathieuchopstm committed Jan 9, 2025
1 parent 78300a7 commit 505deab
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions boards/st/nucleo_wb05kz/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ The Zephyr ``nucleo_wb05kz`` board target supports the following hardware featur
+-----------+------------+-------------------------------------+
| ADC | on-chip | adc |
+-----------+------------+-------------------------------------+
| TIMER | on-chip | counter, pwm |
+-----------+------------+-------------------------------------+
| RADIO | on-chip | Bluetooth Low Energy |
+-----------+------------+-------------------------------------+

Expand Down
22 changes: 22 additions & 0 deletions boards/st/nucleo_wb05kz/nucleo_wb05kz.dts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
};
};

pwmleds: pwmleds {
compatible = "pwm-leds";
status = "okay";
pwm_red_led_1: pwm_led_1 {
pwms = <&pwm2 3 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
};
};

gpio_keys {
compatible = "gpio-keys";
user_button_1: button_0 {
Expand All @@ -62,6 +70,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;
Expand Down Expand Up @@ -122,6 +131,19 @@
<&rcc STM32_SRC_SYSCLK SPI3_I2S3_SEL(3)>;
};


&timers2 {
status = "okay";
st,prescaler = <10000>;

pwm2: pwm {
/* PWM on red_led_1 */
pinctrl-0 = <&tim2_ch3_pb2>;
pinctrl-names = "default";
status = "okay";
};
};

&flash0 {
partitions {
compatible = "fixed-partitions";
Expand Down
2 changes: 2 additions & 0 deletions boards/st/nucleo_wb05kz/nucleo_wb05kz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ supported:
- adc
- arduino_i2c
- arduino_spi
- counter
- dma
- gpio
- i2c
- pwm
- spi
- bluetooth
vendor: st

0 comments on commit 505deab

Please sign in to comment.