boards: stm32f411e_disco: Add pwm to drive green led
This enables the fade_led example to work with this board. Signed-off-by: Pauli Salmenrinne <susundberg@gmail.com>
This commit is contained in:
parent
537f3332f0
commit
ca6eee5444
|
@ -13,6 +13,14 @@ if UART_CONSOLE
|
||||||
config UART_2
|
config UART_2
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
|
||||||
|
if PWM
|
||||||
|
|
||||||
|
config PWM_STM32_4
|
||||||
|
default y
|
||||||
|
|
||||||
|
endif # PWM
|
||||||
|
|
||||||
endif # UART_CONSOLE
|
endif # UART_CONSOLE
|
||||||
|
|
||||||
endif # BOARD_STM32F411E_DISCO
|
endif # BOARD_STM32F411E_DISCO
|
||||||
|
|
|
@ -83,6 +83,8 @@ hardware features:
|
||||||
+-----------+------------+-------------------------------------+
|
+-----------+------------+-------------------------------------+
|
||||||
| GPIO | on-chip | gpio |
|
| GPIO | on-chip | gpio |
|
||||||
+-----------+------------+-------------------------------------+
|
+-----------+------------+-------------------------------------+
|
||||||
|
| PWM | on-chip | pwm |
|
||||||
|
+-----------+------------+-------------------------------------+
|
||||||
|
|
||||||
Other hardware features are not yet supported on Zephyr porting.
|
Other hardware features are not yet supported on Zephyr porting.
|
||||||
|
|
||||||
|
@ -103,7 +105,7 @@ Default Zephyr Peripheral Mapping:
|
||||||
- UART_2_TX : PA2
|
- UART_2_TX : PA2
|
||||||
- UART_2_RX : PA3
|
- UART_2_RX : PA3
|
||||||
- LD3 : PD13
|
- LD3 : PD13
|
||||||
- LD4 : PD12
|
- LD4 : PD12 (PWM4 CH1)
|
||||||
- LD5 : PD14
|
- LD5 : PD14
|
||||||
- LD6 : PD15
|
- LD6 : PD15
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,9 @@ static const struct pin_config pinconf[] = {
|
||||||
{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX},
|
{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX},
|
||||||
{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX},
|
{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX},
|
||||||
#endif /* CONFIG_UART_2 */
|
#endif /* CONFIG_UART_2 */
|
||||||
|
#ifdef CONFIG_PWM_STM32_4
|
||||||
|
{STM32_PIN_PD12, STM32F4_PINMUX_FUNC_PD12_PWM4_CH1 },
|
||||||
|
#endif /* CONFIG_PWM_STM32_4 */
|
||||||
};
|
};
|
||||||
|
|
||||||
static int pinmux_stm32_init(struct device *port)
|
static int pinmux_stm32_init(struct device *port)
|
||||||
|
|
|
@ -38,6 +38,13 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pwmleds {
|
||||||
|
compatible = "pwm-leds";
|
||||||
|
green_pwm_led: green_pwm_led {
|
||||||
|
pwms = <&{/soc/timers@40000800/pwm} 1 0>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
gpio_keys {
|
gpio_keys {
|
||||||
compatible = "gpio-keys";
|
compatible = "gpio-keys";
|
||||||
user_button: button {
|
user_button: button {
|
||||||
|
@ -52,9 +59,19 @@
|
||||||
led2 = &red_led_5;
|
led2 = &red_led_5;
|
||||||
led3 = &blue_led_6;
|
led3 = &blue_led_6;
|
||||||
sw0 = &user_button;
|
sw0 = &user_button;
|
||||||
|
pwm-led0 = &green_pwm_led;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
&timers4 {
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
pwm {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
&usart2 {
|
&usart2 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
status = "okay";
|
status = "okay";
|
||||||
|
|
|
@ -407,6 +407,8 @@
|
||||||
|
|
||||||
#define STM32F4_PINMUX_FUNC_PD12_USART3_RTS \
|
#define STM32F4_PINMUX_FUNC_PD12_USART3_RTS \
|
||||||
(STM32_PINMUX_ALT_FUNC_7 | STM32_OPENDRAIN_PULLUP)
|
(STM32_PINMUX_ALT_FUNC_7 | STM32_OPENDRAIN_PULLUP)
|
||||||
|
#define STM32F4_PINMUX_FUNC_PD12_PWM4_CH1 \
|
||||||
|
(STM32_PINMUX_ALT_FUNC_2 | STM32_PUSHPULL_NOPULL)
|
||||||
|
|
||||||
#define STM32F4_PINMUX_FUNC_PD14_PWM4_CH3 \
|
#define STM32F4_PINMUX_FUNC_PD14_PWM4_CH3 \
|
||||||
(STM32_PINMUX_ALT_FUNC_2 | STM32_PUSHPULL_NOPULL)
|
(STM32_PINMUX_ALT_FUNC_2 | STM32_PUSHPULL_NOPULL)
|
||||||
|
|
Loading…
Reference in a new issue