ADC: Use 16-bit raw values for calculations

Using 16-bit for calculation allows to increase resolution by oversampling.
The ADC was already configured to use left-aligned 12-bit readings, which can
be treated the same as 16-bit native readings.
This commit is contained in:
Martin Jäger
2020-09-21 13:29:31 +02:00
committed by Martin Jäger
parent 3bb4a86b5c
commit 4008a09f3b
4 changed files with 27 additions and 25 deletions
+1 -1
View File
@@ -38,7 +38,7 @@
#if defined(CONFIG_SOC_SERIES_STM32F0X) || defined(CONFIG_SOC_SERIES_STM32L0X)
// automatich channel selection based on devicetree settings
// automatic channel selection based on devicetree settings
#define ADC_CHSEL_FN(node_id) (1UL << DT_PHA(node_id, io_channels, input)) |
#define ADC_CHSEL (DT_FOREACH_CHILD(DT_PATH(adc_inputs), ADC_CHSEL_FN) 0)