boards: nucleo_f401re: added pwm-led0

Added onboard led to the devicetree to be supported also with pwm-led0

Signed-off-by: Dimitris Tassopoulos <dimtass@gmail.com>
This commit is contained in:
Dimitris Tassopoulos 2020-06-07 21:34:45 +02:00 committed by Ioannis Glaropoulos
commit c2e9c1fa49
3 changed files with 11 additions and 1 deletions

View file

@ -29,6 +29,13 @@
}; };
}; };
pwmleds {
compatible = "pwm-leds";
green_pwm_led: green_pwm_led {
pwms = <&pwm2 1 0>;
};
};
gpio_keys { gpio_keys {
compatible = "gpio-keys"; compatible = "gpio-keys";
user_button: button { user_button: button {
@ -40,6 +47,7 @@
aliases { aliases {
led0 = &green_led_2; led0 = &green_led_2;
sw0 = &user_button; sw0 = &user_button;
pwm-led0 = &green_pwm_led;
}; };
}; };

View file

@ -23,7 +23,7 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX}, {STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX},
#endif #endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pwm2), okay) && CONFIG_PWM #if DT_NODE_HAS_STATUS(DT_NODELABEL(pwm2), okay) && CONFIG_PWM
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_PWM2_CH1},
#endif #endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C #if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C
{STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL}, {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL},

View file

@ -77,6 +77,8 @@
#define STM32F4_PINMUX_FUNC_PA4_ADC12_IN4 \ #define STM32F4_PINMUX_FUNC_PA4_ADC12_IN4 \
STM32_MODER_ANALOG_MODE STM32_MODER_ANALOG_MODE
#define STM32F4_PINMUX_FUNC_PA5_PWM2_CH1 \
(STM32_PINMUX_ALT_FUNC_1 | STM32_PUSHPULL_PULLUP)
#define STM32F4_PINMUX_FUNC_PA5_SPI1_SCK \ #define STM32F4_PINMUX_FUNC_PA5_SPI1_SCK \
(STM32_PINMUX_ALT_FUNC_5 | STM32_PUSHPULL_NOPULL | \ (STM32_PINMUX_ALT_FUNC_5 | STM32_PUSHPULL_NOPULL | \
STM32_OSPEEDR_VERY_HIGH_SPEED) STM32_OSPEEDR_VERY_HIGH_SPEED)