samples: pwm for stm32l073 and stm32f091 nucleo boards
The overlay are defined to run the samples application with PWM feature on the nucleo_l073rz,nucleo_f091rc, nucleo_g474re Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
parent
08e3ce0ebc
commit
2620c53771
4 changed files with 132 additions and 0 deletions
33
samples/basic/blinky_pwm/boards/nucleo_f091rc.overlay
Normal file
33
samples/basic/blinky_pwm/boards/nucleo_f091rc.overlay
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dt-bindings/pwm/pwm.h>
|
||||||
|
|
||||||
|
|
||||||
|
/ {
|
||||||
|
pwmleds {
|
||||||
|
compatible = "pwm-leds";
|
||||||
|
|
||||||
|
green_pwm_led: green_pwm_led {
|
||||||
|
pwms = <&pwm2 1 4 PWM_POLARITY_NORMAL>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
aliases {
|
||||||
|
pwm-led0 = &green_pwm_led;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&timers2 {
|
||||||
|
st,prescaler = <10000>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
pwm2: pwm {
|
||||||
|
status = "okay";
|
||||||
|
pinctrl-0 = <&tim2_ch1_pa5>; /* might conflict with SPI1 */
|
||||||
|
pinctrl-names = "default";
|
||||||
|
};
|
||||||
|
};
|
33
samples/basic/blinky_pwm/boards/nucleo_l073rz.overlay
Normal file
33
samples/basic/blinky_pwm/boards/nucleo_l073rz.overlay
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dt-bindings/pwm/pwm.h>
|
||||||
|
|
||||||
|
|
||||||
|
/ {
|
||||||
|
pwmleds {
|
||||||
|
compatible = "pwm-leds";
|
||||||
|
|
||||||
|
green_pwm_led: green_pwm_led {
|
||||||
|
pwms = <&pwm2 1 4 PWM_POLARITY_NORMAL>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
aliases {
|
||||||
|
pwm-led0 = &green_pwm_led;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&timers2 {
|
||||||
|
st,prescaler = <10000>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
pwm2: pwm {
|
||||||
|
status = "okay";
|
||||||
|
pinctrl-0 = <&tim2_ch1_pa5>; /* might conflict with SPI1 */
|
||||||
|
pinctrl-names = "default";
|
||||||
|
};
|
||||||
|
};
|
33
samples/drivers/led_pwm/boards/nucleo_f091rc.overlay
Normal file
33
samples/drivers/led_pwm/boards/nucleo_f091rc.overlay
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dt-bindings/pwm/pwm.h>
|
||||||
|
|
||||||
|
|
||||||
|
/ {
|
||||||
|
pwmleds {
|
||||||
|
compatible = "pwm-leds";
|
||||||
|
|
||||||
|
green_pwm_led: green_pwm_led {
|
||||||
|
pwms = <&pwm2 1 4 PWM_POLARITY_NORMAL>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
aliases {
|
||||||
|
pwm-led0 = &green_pwm_led;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&timers2 {
|
||||||
|
st,prescaler = <10000>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
pwm2: pwm {
|
||||||
|
status = "okay";
|
||||||
|
pinctrl-0 = <&tim2_ch1_pa5>; /* might conflict with SPI1 */
|
||||||
|
pinctrl-names = "default";
|
||||||
|
};
|
||||||
|
};
|
33
samples/drivers/led_pwm/boards/nucleo_l073rz.overlay
Normal file
33
samples/drivers/led_pwm/boards/nucleo_l073rz.overlay
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dt-bindings/pwm/pwm.h>
|
||||||
|
|
||||||
|
|
||||||
|
/ {
|
||||||
|
pwmleds {
|
||||||
|
compatible = "pwm-leds";
|
||||||
|
|
||||||
|
green_pwm_led: green_pwm_led {
|
||||||
|
pwms = <&pwm2 1 4 PWM_POLARITY_NORMAL>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
aliases {
|
||||||
|
pwm-led0 = &green_pwm_led;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&timers2 {
|
||||||
|
st,prescaler = <10000>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
pwm2: pwm {
|
||||||
|
status = "okay";
|
||||||
|
pinctrl-0 = <&tim2_ch1_pa5>; /* might conflict with SPI1 */
|
||||||
|
pinctrl-names = "default";
|
||||||
|
};
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue