Hi,
please see https://wiki.st.com/stm32mpu/wiki/ADC_device_tree_configuration#DT_configuration_-28board_level-29
As ANA0 and ANA1 are directly connected to ADC input pins, there is no need of pinmux setting for those inputs.
ANA0 is directly connected to both ADC1 in0 and ADC2 in0
ANA1 is directly connected to both ADC1 in1 and ADC2 in1
So, a DT example using ANA0 on ADC1 and ANA1 on ADC2:
&adc {
/* ADC1 & ADC2 common resources */
pinctrl-names = "default";
vdda-supply = <&vdda>; /* Example to supply vdda pin by using a PMIC regulator */
vref-supply = <&vrefbuf>; /* Example to use VREFBUF (It needs to be enabled as well) */
status = "okay"; /* Enable ADC12 block */
adc1: adc@0 {
/* private resources for ADC1 */
st,adc-channels = <0>; /* ADC1 in0 channel is used */
st,min-sample-time-nsecs = <10000>; /* 10µs sampling time */
status = "okay"; /* Enable ADC1 */
};
adc2: adc@100 {
/* private resources for ADC2 */
st,adc-channels = <1>; /* ADC2 in1 channel is used */
st,min-sample-time-nsecs = <10000>; /* 10µs sampling time */
status = "okay"; /* Enable ADC2 */
};
};
If there is other ADCx_IN channels used on regular GPIOs pins, a pinmux will then be required for those pins (which need ADCx_PCSEL setup).
Regards.
Patrick