Skip to content

Commit

Permalink
boards: nucleo_l476rg and nucleo_wb55rg add timers
Browse files Browse the repository at this point in the history
nucleo_l476rg:
adds tim3 with pwm on pb4, changes tim2 pwm pin from pa0 to pb10.
As a result timers are available on arduino pins D5 and D6.

nucleo_wb55rg:
adds tim1 with pwm on pa8, changes tim2 pwm pin from pa0 to pa15.
As a result timers are available on arduino pins D5 and D6.

Use default prescaler (==1) for 32-bit timer and
10.001 for 16-bit timers, as these are commonly used.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
  • Loading branch information
str4t0m authored and cfriedt committed Aug 13, 2021
1 parent 405c697 commit 374aab1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion boards/arm/nucleo_l476rg/nucleo_l476rg.dts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,17 @@

pwm2: pwm {
status = "okay";
pinctrl-0 = <&tim2_ch1_pa0>;
pinctrl-0 = <&tim2_ch3_pb10>;
};
};

&timers3 {
status = "okay";

pwm3: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim3_ch1_pb4>;
};
};

Expand Down
12 changes: 11 additions & 1 deletion boards/arm/nucleo_wb55rg/nucleo_wb55rg.dts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,21 @@
status = "okay";
};

&timers1 {
status = "okay";

pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch1_pa8>;
};
};

&timers2 {
status = "okay";
pwm2: pwm {
status = "okay";
pinctrl-0 = <&tim2_ch1_pa0>;
pinctrl-0 = <&tim2_ch1_pa15>;
};
};

Expand Down

0 comments on commit 374aab1

Please sign in to comment.