Skip to content

Commit ba212fd

Browse files
Mathieu Choplainkartben
authored andcommitted
boards: st: nucleo_wb09ke: add PWM support and LED
Add the PWM LED to Nucleo-WB09KE board and mark as compatible with PWM. Also mark counters as supported (but don't enable by default). Signed-off-by: Mathieu Choplain <[email protected]>
1 parent fc61e64 commit ba212fd

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

boards/st/nucleo_wb09ke/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ The Zephyr ``nucleo_wb09ke`` board target supports the following hardware featur
5252
+-----------+------------+-------------------------------------+
5353
| ADC | on-chip | adc |
5454
+-----------+------------+-------------------------------------+
55+
| TIMER | on-chip | counter, pwm |
56+
+-----------+------------+-------------------------------------+
5557
| RADIO | on-chip | Bluetooth Low Energy |
5658
+-----------+------------+-------------------------------------+
5759

boards/st/nucleo_wb09ke/nucleo_wb09ke.dts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
};
4040
};
4141

42+
pwmleds: pwmleds {
43+
compatible = "pwm-leds";
44+
status = "okay";
45+
pwm_red_led_1: pwm_led_1 {
46+
pwms = <&pwm2 3 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
47+
};
48+
};
49+
4250
gpio_keys {
4351
compatible = "gpio-keys";
4452
user_button_1: button_0 {
@@ -62,6 +70,7 @@
6270
led0 = &blue_led_1;
6371
led1 = &green_led_1;
6472
led2 = &red_led_1;
73+
pwm-led0 = &pwm_red_led_1;
6574
sw0 = &user_button_1;
6675
sw1 = &user_button_2;
6776
sw2 = &user_button_3;
@@ -122,6 +131,18 @@
122131
<&rcc STM32_SRC_SYSCLK SPI3_I2S3_SEL(3)>;
123132
};
124133

134+
&timers2 {
135+
status = "okay";
136+
st,prescaler = <10000>;
137+
138+
pwm2: pwm {
139+
/* PWM on red_led_1 */
140+
pinctrl-0 = <&tim2_ch3_pb2>;
141+
pinctrl-names = "default";
142+
status = "okay";
143+
};
144+
};
145+
125146
&flash0 {
126147
partitions {
127148
compatible = "fixed-partitions";

boards/st/nucleo_wb09ke/nucleo_wb09ke.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ supported:
1212
- adc
1313
- arduino_i2c
1414
- arduino_spi
15+
- counter
1516
- dma
1617
- gpio
1718
- i2c
19+
- pwm
1820
- spi
1921
- bluetooth
2022
vendor: st

0 commit comments

Comments
 (0)