nuttx/arch/arm
Daniel P. Carvalho 9e93888220 stm32/adc: add support for differential mode (DIFSEL) and calibration
Add board-level configuration and driver support for differential input
channels and auto-calibration on STM32 ADC IPv2 and IPv2G4 (STM32F3,
STM32G4), following the STM32H5 architecture pattern requested in review:

- In hardware headers (stm32_adc_v2.h and stm32_adc_v2g4.h), fix register
  comments and define ADC_DIFSEL register shift and masks.
- In stm32_adc_m3m4_v1v2.c:
  - Add difsel field to struct stm32_dev_s initialized from
    BOARD_ADCx_DIFSEL if defined, falling back to ADC_DIFSEL_DEFAULT (0).
  - Configure DIFSEL before enabling the ADC in adc_configure().
  - Fix and enable adc_calibrate() for HAVE_IP_ADC_V2, supporting both
    single-ended calibration (ADCALDIF=0) and differential calibration
    (ADCALDIF=1) based on the channel selection.

Verified on Nucleo-G431KB (single-ended and differential channel 1).

Assisted-by: Gemini:gemini-2.5-pro
Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com>
2026-09-18 08:46:18 -03:00
..
include arch/arm/n32h7: Add N32H762IIL7 BSP 2026-09-17 09:39:41 -03:00
src stm32/adc: add support for differential mode (DIFSEL) and calibration 2026-09-18 08:46:18 -03:00
CMakeLists.txt
Kconfig arch/arm/n32h7: Add N32H762IIL7 BSP 2026-09-17 09:39:41 -03:00