Commit 971de254 authored by Erwan Gouriou's avatar Erwan Gouriou Committed by Kumar Gala
Browse files

pinmux: prepare support for stm32 PWM driver



Add pin config for PWM support on ST Nucleo boards
Following config is chosen:
-PA0/PWM2_CH1 for F401RE and L476RG
-PA8/PWM1_CH2 for F103RB

Change-Id: I013e15ed35360d7777bb24ff94e0830f913a6580
Signed-off-by: default avatarErwan Gouriou <erwan.gouriou@linaro.org>
parent bd271774
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@ static const struct pin_config pinconf[] = {
	{STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_USART3_TX},
	{STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_USART3_RX},
#endif	/* CONFIG_UART_STM32_PORT_3 */
#ifdef CONFIG_PWM_STM32_1
	{STM32_PIN_PA8, STM32F1_PINMUX_FUNC_PA8_PWM1_CH1},
#endif /* CONFIG_PWM_STM32_1 */
};

static int pinmux_stm32_init(struct device *port)
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ static const struct pin_config pinconf[] = {
	{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX},
	{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX},
#endif	/* CONFIG_UART_STM32_PORT_2 */
#ifdef CONFIG_PWM_STM32_2
	{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */
};

static int pinmux_stm32_init(struct device *port)
+3 −0
Original line number Diff line number Diff line
@@ -42,6 +42,9 @@ static const struct pin_config pinconf[] = {
	{STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL},
	{STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA},
#endif /* CONFIG_I2C_0 */
#ifdef CONFIG_PWM_STM32_2
	{STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */
};

static int pinmux_stm32_init(struct device *port)
+1 −0
Original line number Diff line number Diff line
@@ -30,5 +30,6 @@
#define STM32F1_PINMUX_FUNC_PB10_USART3_TX STM32_PINMUX_FUNC_ALT_1
#define STM32F1_PINMUX_FUNC_PB11_USART3_RX STM32_PINMUX_FUNC_ALT_1

#define STM32F1_PINMUX_FUNC_PA8_PWM1_CH1 STM32_PINMUX_FUNC_ALT_2

#endif /* _STM32F1_PINMUX_H_ */
+2 −0
Original line number Diff line number Diff line
@@ -30,4 +30,6 @@
#define STM32F4_PINMUX_FUNC_PA2_USART2_TX STM32_PINMUX_FUNC_ALT_7
#define STM32F4_PINMUX_FUNC_PA3_USART2_RX STM32_PINMUX_FUNC_ALT_7

#define STM32F4_PINMUX_FUNC_PA0_PWM2_CH1 STM32_PINMUX_FUNC_ALT_1

#endif /* _STM32F4_PINMUX_H_ */
Loading