Skip to content
Permalink
Browse files

drivers: pinmux: stm32: add pinmux support for ADC of stm32

This commit adds pinmux defines for all the external ADC lines
supported by stm32. All defines are named after the datasheet of the
corresponding product lines.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
  • Loading branch information...
cybertale authored and nashif committed May 7, 2019
1 parent da56cad commit 5e942638a2858a6ad84acc7f3b11db7160c08eda
@@ -108,4 +108,37 @@
#define STM32F0_PINMUX_FUNC_PD1_CAN_TX \
(STM32_PINMUX_ALT_FUNC_0 | STM32_PUSHPULL_NOPULL)

#define STM32F0_PINMUX_FUNC_PA0_ADC_IN0 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PA1_ADC_IN1 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PA2_ADC_IN2 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PA3_ADC_IN3 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PA4_ADC_IN4 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PA5_ADC_IN5 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PA6_ADC_IN6 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PA7_ADC_IN7 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PB0_ADC_IN8 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PB1_ADC_IN9 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PC0_ADC_IN10 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PC1_ADC_IN11 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PC2_ADC_IN12 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PC3_ADC_IN13 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PC4_ADC_IN14 \
STM32_MODER_ANALOG_MODE
#define STM32F0_PINMUX_FUNC_PC5_ADC_IN15 \
STM32_MODER_ANALOG_MODE

#endif /* ZEPHYR_DRIVERS_PINMUX_STM32_PINMUX_STM32F0_H_ */
@@ -70,4 +70,26 @@

#define STM32F1_PINMUX_FUNC_PA8_PWM1_CH1 STM32_PIN_PWM

#define STM32F1_PINMUX_FUNC_PF6_ADC3_IN4 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PF7_ADC3_IN5 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PF8_ADC3_IN6 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PF9_ADC3_IN7 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PF10_ADC3_IN8 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PC0_ADC123_IN10 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PC1_ADC123_IN11 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PC2_ADC123_IN12 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PC3_ADC123_IN13 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PA0_ADC123_IN0 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PA1_ADC123_IN1 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PA2_ADC123_IN2 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PA3_ADC123_IN3 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PA4_ADC12_IN4 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PA5_ADC12_IN5 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PA6_ADC12_IN6 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PA7_ADC12_IN7 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PC4_ADC12_IN14 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PC4_ADC12_IN15 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PB0_ADC12_IN8 STM32_CNF_IN_ANALOG
#define STM32F1_PINMUX_FUNC_PB1_ADC12_IN9 STM32_CNF_IN_ANALOG

#endif /* ZEPHYR_DRIVERS_PINMUX_STM32_PINMUX_STM32F1_H_ */
@@ -24,25 +24,44 @@
#define STM32F2_PINMUX_FUNC_PA1_ETH \
(STM32_PINMUX_ALT_FUNC_11 | STM32_PUSHPULL_NOPULL | \
STM32_OSPEEDR_VERY_HIGH_SPEED)
#define STM32F2_PINMUX_FUNC_PA0_ADC123_IN0 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PA1_UART4_RX \
(STM32_PINMUX_ALT_FUNC_8 | STM32_PUSHPULL_NOPULL)
#define STM32F2_PINMUX_FUNC_PA1_ADC123_IN1 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PA2_USART2_TX \
(STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)
#define STM32F2_PINMUX_FUNC_PA2_ETH \
(STM32_PINMUX_ALT_FUNC_11 | STM32_PUSHPULL_NOPULL | \
STM32_OSPEEDR_VERY_HIGH_SPEED)
#define STM32F2_PINMUX_FUNC_PA2_ADC123_IN2 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PA3_USART2_RX \
(STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)
#define STM32F2_PINMUX_FUNC_PA3_ETH \
(STM32_PINMUX_ALT_FUNC_11 | STM32_PUSHPULL_NOPULL | \
STM32_OSPEEDR_VERY_HIGH_SPEED)
#define STM32F2_PINMUX_FUNC_PA3_ADC123_IN3 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PA4_ADC12_IN4 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PA5_ADC12_IN5 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PA6_ADC12_IN6 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PA7_ETH \
(STM32_PINMUX_ALT_FUNC_11 | STM32_PUSHPULL_NOPULL | \
STM32_OSPEEDR_VERY_HIGH_SPEED)
#define STM32F2_PINMUX_FUNC_PA7_ADC12_IN7 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PA9_USART1_TX \
(STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)
@@ -57,6 +76,12 @@
(STM32_PINMUX_ALT_FUNC_10 | STM32_PUSHPULL_NOPULL)

/* Port B */
#define STM32F2_PINMUX_FUNC_PB0_ADC12_IN8 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PB1_ADC12_IN9 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PB6_USART1_TX \
(STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)

@@ -81,17 +106,32 @@
STM32_OSPEEDR_VERY_HIGH_SPEED)

/* Port C */
#define STM32F2_PINMUX_FUNC_PC0_ADC123_IN10 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PC1_ETH \
(STM32_PINMUX_ALT_FUNC_11 | STM32_PUSHPULL_NOPULL | \
STM32_OSPEEDR_VERY_HIGH_SPEED)
#define STM32F2_PINMUX_FUNC_PC1_ADC123_IN11 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PC2_ADC123_IN12 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PC3_ADC123_IN13 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PC4_ETH \
(STM32_PINMUX_ALT_FUNC_11 | STM32_PUSHPULL_NOPULL | \
STM32_OSPEEDR_VERY_HIGH_SPEED)
#define STM32F2_PINMUX_FUNC_PC4_ADC12_IN14 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PC5_ETH \
(STM32_PINMUX_ALT_FUNC_11 | STM32_PUSHPULL_NOPULL | \
STM32_OSPEEDR_VERY_HIGH_SPEED)
#define STM32F2_PINMUX_FUNC_PC5_ADC12_IN15 \
STM32_MODER_ANALOG_MODE

#define STM32F2_PINMUX_FUNC_PC6_USART6_TX \
(STM32_PINMUX_ALT_FUNC_8 | STM32_PUSHPULL_PULLUP)
@@ -131,6 +171,22 @@
/* Port E */

/* Port F */
#define STM32F2_PINMUX_FUNC_PF3_ADC3_IN9 \
STM32_MODER_ANALOG_MODE
#define STM32F2_PINMUX_FUNC_PF4_ADC3_IN14 \
STM32_MODER_ANALOG_MODE
#define STM32F2_PINMUX_FUNC_PF5_ADC3_IN15 \
STM32_MODER_ANALOG_MODE
#define STM32F2_PINMUX_FUNC_PF6_ADC3_IN4 \
STM32_MODER_ANALOG_MODE
#define STM32F2_PINMUX_FUNC_PF7_ADC3_IN5 \
STM32_MODER_ANALOG_MODE
#define STM32F2_PINMUX_FUNC_PF8_ADC3_IN6 \
STM32_MODER_ANALOG_MODE
#define STM32F2_PINMUX_FUNC_PF9_ADC3_IN7 \
STM32_MODER_ANALOG_MODE
#define STM32F2_PINMUX_FUNC_PF10_ADC3_IN8 \
STM32_MODER_ANALOG_MODE

/* Port G */
#define STM32F2_PINMUX_FUNC_PG9_USART6_RX \
@@ -115,4 +115,85 @@
#define STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI \
(STM32_PINMUX_ALT_FUNC_5 | STM32_PUSHPULL_NOPULL)

#define STM32F3_PINMUX_FUNC_PF2_ADC12_IN10 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PF4_ADC1_IN5 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PC0_ADC12_IN6 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PC1_ADC12_IN7 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PC2_ADC12_IN8 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PC3_ADC12_IN9 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PA0_ADC1_IN1 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PA1_ADC1_IN2 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PA2_ADC1_IN3 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PA3_ADC1_IN4 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PA4_ADC2_IN1 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PA5_ADC2_IN2 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PA6_ADC2_IN3 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PA7_ADC2_IN4 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PC4_ADC2_IN5 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PC5_ADC2_IN11 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PB0_ADC3_IN12 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PB1_ADC3_IN1 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PB2_ADC2_IN12 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PE7_ADC3_IN13 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PE8_ADC34_IN6 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PE9_ADC3_IN2 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PE10_ADC3_IN14 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PE11_ADC3_IN15 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PE12_ADC3_IN16 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PE13_ADC3_IN3 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PE14_ADC4_IN1 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PE15_ADC4_IN12 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PB11_ADC12_IN14 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PB12_ADC4_IN3 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PB13_ADC3_IN5 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PB14_ADC4_IN4 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PB15_ADC4_IN5 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PD8_ADC4_IN12 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PD9_ADC4_IN13 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PD10_ADC34_IN7 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PD11_ADC12_IN8 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PD12_ADC34_IN9 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PD13_ADC34_IN10 \
STM32_MODER_ANALOG_MODE
#define STM32F3_PINMUX_FUNC_PD14_ADC34_IN11 \
STM32_MODER_ANALOG_MODE

#endif /* ZEPHYR_DRIVERS_PINMUX_STM32_PINMUX_STM32F3_H_ */

0 comments on commit 5e94263

Please sign in to comment.
You can’t perform that action at this time.