Please sign in to comment.
drivers: adc: add driver support for ADC1 of stm32
This commit adds driver support for ADC1 on all 8 supported series of stm32 with resolution and conversion time selection and calibration. Currently DMA is not supported for all series, and without it, zephyr won't be able to catch up ADC's end of conversion interrupt, so this version of the driver supports one channel conversion only. Users want multi-channel conversion should use multiple sequences in their app code. This driver uses LL lib rather than HAL because the current HAL lib for ADC will call HAL_DMA_* functions rather than using zephyr's common DMA interface, so that way the driver will break the consistency of the code. This driver has been tested on multiple nucleo boards including NUCLEO_F091RC/F103RB/F207ZG/F302R8/F401RE/F746ZG/L073RZ/L476RG and all passed the test cases in tests/drivers/adc/adc_api. If the external ADC line is floating, it may fail the tests since ADC may get 0V and the test cases think 0 is failing. Connect it to any voltage source between 0-3.3V will help passing the test cases. Signed-off-by: Song Qiang <email@example.com>
- Loading branch information...
Showing with 709 additions and 0 deletions.
- +2 −0 CODEOWNERS
- +1 −0 drivers/adc/CMakeLists.txt
- +2 −0 drivers/adc/Kconfig
- +25 −0 drivers/adc/Kconfig.stm32
- +640 −0 drivers/adc/adc_stm32.c
- +7 −0 soc/arm/st_stm32/common/Kconfig.defconfig.series
- +4 −0 soc/arm/st_stm32/stm32f0/soc.h
- +4 −0 soc/arm/st_stm32/stm32f1/soc.h
- +4 −0 soc/arm/st_stm32/stm32f2/soc.h
- +4 −0 soc/arm/st_stm32/stm32f3/soc.h
- +4 −0 soc/arm/st_stm32/stm32f4/soc.h
- +4 −0 soc/arm/st_stm32/stm32f7/soc.h
- +4 −0 soc/arm/st_stm32/stm32l0/soc.h
- +4 −0 soc/arm/st_stm32/stm32l4/soc.h
|@@ -0,0 +1,25 @@|
|# Kconfig - ADC configuration options|
|# Copyright (c) 2019 Intel Corporation|
|# Copyright (c) 2019 Endre Karlson|
|# Copyright (c) 2019 Song Qiang <firstname.lastname@example.org>|
|# SPDX-License-Identifier: Apache-2.0|
|bool "STM32 ADC driver"|
|depends on SOC_FAMILY_STM32|
|Enable the driver implementation for the stm32xx ADC|
|endif # ADC_STM32|
Oops, something went wrong.