boards: arm: stm32: use DT for ADC pinmux
Use the new DT facilities to configure ADC pinmux on all boards with STM32 MCUs currently supporting the ADC. Signed-off-by: Martin Jäger <martin@libre.solar>
This commit is contained in:
parent
72947484f1
commit
cd908d9085
|
@ -120,6 +120,8 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in10_pc0 &adc1_in11_pc1
|
||||
&adc1_in12_pc2 &adc1_in13_pc3>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -54,12 +54,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL},
|
||||
{STM32_PIN_PB11, STM32F4_PINMUX_FUNC_PB11_I2C2_SDA},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PC0, STM32F4_PINMUX_FUNC_PC0_ADC123_IN10},
|
||||
{STM32_PIN_PC1, STM32F4_PINMUX_FUNC_PC1_ADC123_IN11},
|
||||
{STM32_PIN_PC2, STM32F4_PINMUX_FUNC_PC2_ADC123_IN12},
|
||||
{STM32_PIN_PC3, STM32F4_PINMUX_FUNC_PC3_ADC123_IN13},
|
||||
#endif
|
||||
#ifdef CONFIG_USB_DC_STM32
|
||||
{STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM},
|
||||
{STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP},
|
||||
|
|
|
@ -111,5 +111,6 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in1_pa1>;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -31,9 +31,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM},
|
||||
{STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP},
|
||||
#endif /* CONFIG_USB_DC_STM32 */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA1, STM32F4_PINMUX_FUNC_PA1_ADC123_IN1},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -216,5 +216,8 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in5_pa0 &adc1_in3_pc2
|
||||
&adc1_in4_pc3 &adc1_in13_pc4
|
||||
&adc1_in14_pc5>;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -44,13 +44,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA11, STM32L4X_PINMUX_FUNC_PA11_OTG_FS_DM},
|
||||
{STM32_PIN_PA12, STM32L4X_PINMUX_FUNC_PA12_OTG_FS_DP},
|
||||
#endif /* CONFIG_USB_DC_STM32 */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_ADC12_IN5},
|
||||
{STM32_PIN_PC2, STM32L4X_PINMUX_FUNC_PC2_ADC123_IN3},
|
||||
{STM32_PIN_PC3, STM32L4X_PINMUX_FUNC_PC3_ADC123_IN4},
|
||||
{STM32_PIN_PC4, STM32L4X_PINMUX_FUNC_PC4_ADC12_IN13},
|
||||
{STM32_PIN_PC5, STM32L4X_PINMUX_FUNC_PC5_ADC12_IN14},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc_in0_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -32,9 +32,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PB14, STM32F0_PINMUX_FUNC_PB14_SPI2_MISO},
|
||||
{STM32_PIN_PB15, STM32F0_PINMUX_FUNC_PB15_SPI2_MOSI},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32F0_PINMUX_FUNC_PA0_ADC_IN0},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -80,5 +80,6 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in0_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -30,9 +30,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO},
|
||||
{STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32F1_PINMUX_FUNC_PA0_ADC123_IN0},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in0_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -31,9 +31,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA11, STM32F2_PINMUX_FUNC_PA11_OTG_FS_DM},
|
||||
{STM32_PIN_PA12, STM32F2_PINMUX_FUNC_PA12_OTG_FS_DP},
|
||||
#endif /* CONFIG_USB_DC_STM32 */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32F2_PINMUX_FUNC_PA0_ADC123_IN0},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -81,5 +81,6 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in1_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -26,9 +26,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO},
|
||||
{STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32F3_PINMUX_FUNC_PA0_ADC1_IN1},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -127,6 +127,7 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in0_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -34,9 +34,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO},
|
||||
{STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_SPI2_MOSI},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_ADC123_IN0},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in0_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -43,9 +43,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM},
|
||||
{STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP},
|
||||
#endif /* CONFIG_USB_DC_STM32 */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_ADC123_IN0},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -117,6 +117,7 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in0_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -47,9 +47,6 @@ static const struct pin_config pinconf[] = {
|
|||
{ STM32_PIN_PA6, STM32F7_PINMUX_FUNC_PA6_SPI1_MISO },
|
||||
{ STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_SPI1_MOSI },
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{ STM32_PIN_PA0, STM32F7_PINMUX_FUNC_PA0_ADC123_IN0 },
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -120,6 +120,7 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in0_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -47,9 +47,6 @@ static const struct pin_config pinconf[] = {
|
|||
{ STM32_PIN_PA6, STM32F7_PINMUX_FUNC_PA6_SPI1_MISO },
|
||||
{ STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_SPI1_MOSI },
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{ STM32_PIN_PA0, STM32F7_PINMUX_FUNC_PA0_ADC123_IN0 },
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -162,7 +162,7 @@ Default Zephyr Peripheral Mapping:
|
|||
- LD2 : PA5
|
||||
- USB DM : PA11
|
||||
- USB DP : PA12
|
||||
- ADC1 : PA0
|
||||
- ADC1_IN1 : PA0
|
||||
|
||||
System Clock
|
||||
------------
|
||||
|
|
|
@ -115,5 +115,6 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in1_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -50,9 +50,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA11, STM32G4X_PINMUX_FUNC_PA11_USB_DM},
|
||||
{STM32_PIN_PA12, STM32G4X_PINMUX_FUNC_PA12_USB_DP},
|
||||
#endif /* CONFIG_USB_DC_STM32 */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32G4X_PINMUX_FUNC_PA0_ADC12_IN1},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -135,7 +135,7 @@ and a ST morpho connector. Board is configured as follows:
|
|||
- LD2 : PB7
|
||||
- LD3 : PB14
|
||||
- I2C : PB8, PB9
|
||||
- ADC12_INP15 : PA3
|
||||
- ADC1_INP15 : PA3
|
||||
|
||||
System Clock
|
||||
------------
|
||||
|
|
|
@ -81,7 +81,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
&adc1_2 {
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_inp15_pa3>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -18,9 +18,6 @@ static const struct pin_config pinconf[] = {
|
|||
{ STM32_PIN_PB8, STM32H7_PINMUX_FUNC_PB8_I2C1_SCL },
|
||||
{ STM32_PIN_PB9, STM32H7_PINMUX_FUNC_PB9_I2C1_SDA },
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1_2), okay) && CONFIG_ADC
|
||||
{ STM32_PIN_PA3, STM32H7_PINMUX_FUNC_PA3_ADC12_INP15 },
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc_in0_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -23,9 +23,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA6, STM32L0_PINMUX_FUNC_PA6_SPI1_MISO},
|
||||
{STM32_PIN_PA7, STM32L0_PINMUX_FUNC_PA7_SPI1_MOSI},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32L0_PINMUX_FUNC_PA0_ADC_IN0},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc_in0_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -17,9 +17,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PB8, STM32L1X_PINMUX_FUNC_PB8_I2C1_SCL},
|
||||
{STM32_PIN_PB9, STM32L1X_PINMUX_FUNC_PB9_I2C1_SDA},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32L1X_PINMUX_FUNC_PA0_ADC1_IN0},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -87,5 +87,6 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in1_pc0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -51,9 +51,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PC11, STM32L4X_PINMUX_FUNC_PC11_SPI3_MISO},
|
||||
{STM32_PIN_PC12, STM32L4X_PINMUX_FUNC_PC12_SPI3_MOSI},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PC0, STM32L4X_PINMUX_FUNC_PC0_ADC123_IN1},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -122,5 +122,6 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in1_pc0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -50,9 +50,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA11, STM32L4X_PINMUX_FUNC_PA11_OTG_FS_DM},
|
||||
{STM32_PIN_PA12, STM32L4X_PINMUX_FUNC_PA12_OTG_FS_DP},
|
||||
#endif /* CONFIG_USB_DC_STM32 */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PC0, STM32L4X_PINMUX_FUNC_PC0_ADC123_IN1},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in3_pc2>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -30,9 +30,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA6, STM32WBX_PINMUX_FUNC_PA6_SPI1_MISO},
|
||||
{STM32_PIN_PA7, STM32WBX_PINMUX_FUNC_PA7_SPI1_MOSI},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PC2, STM32WBX_PINMUX_FUNC_PC2_ADC1_IN3},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usb), okay)
|
||||
{STM32_PIN_PA11, STM32WBX_PINMUX_FUNC_PA11_USB_DM},
|
||||
{STM32_PIN_PA12, STM32WBX_PINMUX_FUNC_PA12_USB_DP},
|
||||
|
|
|
@ -89,6 +89,8 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
/* adc1_in14_pc4 is used to sense the USB voltage */
|
||||
pinctrl-0 = <&adc1_in1_pa1 &adc1_in14_pc4>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
@ -42,11 +42,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA11, STM32F1_PINMUX_FUNC_PA11_USB_DM},
|
||||
{STM32_PIN_PA12, STM32F1_PINMUX_FUNC_PA12_USB_DP},
|
||||
#endif /* CONFIG_USB_DC_STM32 */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA1, STM32F1_PINMUX_FUNC_PA1_ADC123_IN1},
|
||||
#endif
|
||||
/* This input is to sense the USB voltage */
|
||||
{STM32_PIN_PC4, STM32F1_PINMUX_FUNC_PC4_ADC12_IN14},
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -42,9 +42,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA11, STM32F1_PINMUX_FUNC_PA11_USB_DM},
|
||||
{STM32_PIN_PA12, STM32F1_PINMUX_FUNC_PA12_USB_DP},
|
||||
#endif /* CONFIG_USB_DC_STM32 */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32F1_PINMUX_FUNC_PA0_ADC123_IN0},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -83,5 +83,6 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in0_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -42,9 +42,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM},
|
||||
{STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP},
|
||||
#endif /* CONFIG_USB_DC_STM32 */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32F3_PINMUX_FUNC_PA0_ADC1_IN1},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -159,5 +159,6 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in1_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -42,9 +42,6 @@ static const struct pin_config pinconf[] = {
|
|||
{STM32_PIN_PA11, STM32F1_PINMUX_FUNC_PA11_USB_DM},
|
||||
{STM32_PIN_PA12, STM32F1_PINMUX_FUNC_PA12_USB_DP},
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC
|
||||
{STM32_PIN_PA0, STM32F1_PINMUX_FUNC_PA0_ADC123_IN0},
|
||||
#endif
|
||||
};
|
||||
|
||||
static int pinmux_stm32_init(const struct device *port)
|
||||
|
|
|
@ -146,5 +146,6 @@
|
|||
};
|
||||
|
||||
&adc1 {
|
||||
pinctrl-0 = <&adc1_in0_pa0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue