Files
Manuele Conti 02e9aebb8e hw/adc/stm32f2xx_adc: fix left-aligned conversion results
Left-aligned regular conversion results must occupy bits [15:4],
[15:6], or [15:8] for 12-, 10-, or 8-bit resolution respectively.
At 6-bit resolution the result is aligned within a byte, in bits [7:2].

The current single-bit shift and 0xFFF0 mask both misalign the result
and discard significant sample bits. Select the shift according to RES
and keep the existing right-aligned sample generation unchanged.

Signed-off-by: Manuele Conti <conti.manuele@gmail.com>
Message-id: 20261020211529.99689-1-conti.manuele@gmail.com
[PMM: expanded comment slightly, added brackets for clarity]

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-10-23 10:01:16 +01:00
..
2024-10-15 15:16:17 +01:00
2024-10-15 15:16:17 +01:00
2021-01-12 21:19:02 +00:00
2025-12-27 10:11:06 +01:00