1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-18 15:55:46 +00:00

Add ADC sampling method option (#8131)

Co-authored-by: Djordje Mandic <6750655+DjordjeMandic@users.noreply.github.com>
This commit is contained in:
Igor Novgorodov
2025-02-10 05:32:54 +01:00
committed by GitHub
parent 0d13e2040d
commit 1ab1768b6a
9 changed files with 132 additions and 30 deletions

View File

@@ -36,6 +36,14 @@ ATTENUATION_MODES = {
"auto": "auto",
}
sampling_mode = adc_ns.enum("SamplingMode", is_class=True)
SAMPLING_MODES = {
"avg": sampling_mode.AVG,
"min": sampling_mode.MIN,
"max": sampling_mode.MAX,
}
adc1_channel_t = cg.global_ns.enum("adc1_channel_t")
adc2_channel_t = cg.global_ns.enum("adc2_channel_t")