Files
rt-thread/components/drivers/adc/Kconfig
T
wdfk-prog 937be2c97d feat[ADC]: 新增 ADC V2 驱动支持 (#11440)
* feat[ADC V2]: add ADC V2 driver support

add ADC V2 core APIs, session state management, and sequence read support
add STM32 ADC V2 HAL backend with internal-channel and VREF handling
add per-series STM32 ADC V2 default configuration headers
wire ADC V2 Kconfig and SConscript integration for components and STM32 BSP drivers
keep ADC V2 mutually exclusive with the legacy ADC driver path

* feat[ADC V2]: add ADC V2 MSH special channel read support

add generic ADC V2 MSH commands for probing, configuring, raw reads, voltage reads, and sequence reads
add STM32 ADC V2 backend special commands for VREFINT, temperature sensor, and VBAT reads
add STM32 helper APIs for special logical channels, sampling time, resolution, and temperature calculation
wire ADC V2 MSH sources through Kconfig and SConscript

* feat[ADC V2]: add ADC V2 stream DMA support

add ADC V2 stream APIs with latest-frame and FIFO buffering policies
wire STM32 ADC V2 to circular DMA stream mode with per-instance Kconfig options
extend STM32 ADC config headers and DMA helpers for stream DMA configuration
add FinSH stream commands for start, read, cancel, and stop operations
handle Cortex-M7 cache-safe DMA buffers for STM32 stream sampling

* feat[ADC V2]: add timer trigger support for ADC V2 streams

add ADC V2 trigger configuration, validation, and lifecycle coordination
add timer update trigger support through clock timer TRGO controls
map STM32 ADC V2 timer update triggers to HAL external trigger selector fields
add Kconfig, SConscript, and MSH entries for ADC trigger setup and inspection

* feat[ADCV2]: add timer and comparator trigger selectors

add ADC V2 timer compare and analog comparator trigger configuration support
extend clock timer trigger config with compare event and channel fields
wire STM32 ADC external trigger selector mappings for TIM update, TIM compare, and COMP output
add FinSH trigger_set commands and Kconfig switches for timer and comparator trigger backends

* fix[ADC V2]: resolve ADC V1 compatibility Kconfig loop

* ci[ADC V2][stm32]: add ADC v2 peripheral config for stm32f407-rt-spark BSP
2026-07-07 08:59:22 +08:00

122 lines
3.9 KiB
Plaintext

menuconfig RT_USING_ADC
bool "Using ADC device drivers"
default n
if RT_USING_ADC
config RT_USING_ADC_V2
bool "Using ADC V2 device drivers"
default n
help
Enable the standalone ADC V2 framework. ADC V2 uses the legacy ADC
public namespace, so it cannot be enabled together with ADC V1.
config RT_USING_ADC_V1
bool
default y if !RT_USING_ADC_V2
if RT_USING_DM && RT_USING_ADC_V1
osource "$(SOC_DM_ADC_DIR)/Kconfig"
endif
if RT_USING_ADC_V2
config RT_ADC_USING_TRIGGER
bool "Enable ADC trigger framework"
default n
help
Enable device-level ADC trigger requests, framework validation, caching,
and stream lifecycle coordination. Timer trigger frequency and TRGO
start/stop are delegated to the timer trigger backend.
config RT_ADC_TRIGGER_USING_TIMER
bool "Enable ADC timer trigger selector support"
depends on RT_ADC_USING_TRIGGER
default n
help
Enable timer update/TRGO and timer compare events as ADC stream
trigger sources.
config RT_ADC_TRIGGER_USING_COMPARE
bool "Enable ADC analog comparator trigger selector support"
depends on RT_ADC_USING_TRIGGER
default n
help
Enable analog comparator output events as ADC stream trigger sources.
config RT_ADC_USING_STREAM
bool "Enable ADC stream framework"
default n
help
Enable long-running ADC stream sessions.
Disable this option to remove ADC stream runtime state, stream APIs,
and stream backend hooks from the ADC V2 framework.
if RT_ADC_USING_STREAM
menu "ADC stream buffering policies"
config RT_ADC_STREAM_USING_LATEST
bool "Enable ADC stream latest-frame policy"
default y
help
Enable the latest-frame ADC stream policy.
This mode is intended for slow-changing or status-like ADC values, such
as battery voltage, temperature, potentiometer input, resistor-divider
voltage, or board health monitoring.
The DMA buffer stores exactly one complete ADC scan frame. Old values
may be overwritten. This mode does not require DMA half-transfer or
transfer-complete data interrupts, and it does not allocate a framework
FIFO.
This option may be enabled together with RT_ADC_STREAM_USING_FIFO. The
active policy is selected per stream at runtime.
config RT_ADC_STREAM_USING_FIFO
bool "Enable ADC stream FIFO policy"
default n
help
Enable the FIFO ADC stream policy.
This mode is intended for continuous and loss-sensitive sampling. The
DMA buffer is used as a staging buffer, and completed DMA data events
are copied into a ringbuffer for ordered blocking reads.
FIFO mode requires DMA data events. The default DMA event mode uses both
half-transfer and transfer-complete events to reduce read latency. A
stream configuration may select full-only events to reduce interrupt
frequency, at the cost of higher latency and larger data bursts.
This option may be enabled together with RT_ADC_STREAM_USING_LATEST. The
active policy is selected per stream at runtime.
comment "At least one ADC stream buffering policy should be enabled"
depends on !RT_ADC_STREAM_USING_LATEST && !RT_ADC_STREAM_USING_FIFO
endmenu
endif
config RT_ADC_V2_USING_MSH
bool "Enable ADC V2 MSH command"
depends on RT_USING_FINSH
default y
help
Enable the ADC V2 MSH command.
This option exports the "adc" shell command for probing ADC devices,
configuring channels, reading raw samples, reading voltage values, and
reading one ADC sequence. When RT_ADC_USING_STREAM is enabled, stream
subcommands are also available.
Disable this option to remove the ADC V2 shell command while keeping
the ADC V2 framework and driver APIs available.
endif
endif