1# Copyright (c) 2022 Wolter HV <wolterhv@gmx.de>
2#
3# SPDX-License-Identifier: Apache-2.0
4
5description: |
6  Espressif ESP32 ADC
7  Possible available resolutions depends on the used chip.
8    - ESP32     < 9,10,11,12 >
9    - ESP32-S2  < 12 >
10    - ESP32-C3  < 12 >
11    - ESP32-S3  < 12 >
12  For chips with configurable resolution feature (ESP32),
13  maximum resolution will be used if not set explicitly.
14
15  Zephyr API is using gain unit to characterize ADC input.
16  To achieve compatibility we choose to select those gain,
17  which corresponds to the ESP32 ADC attenuation feature.
18
19    ESP32,attenuation ~ zephyr,gain
20    -----------------   -----------
21    0 dB                ADC_GAIN_1
22    2.5 dB              ADC_GAIN_4_5
23    6 dB                ADC_GAIN_1_2
24    11 dB               ADC_GAIN_1_4
25
26  In case unsupported gain is selected the adc_channel_setup()
27  would return ENOTSUP error.
28
29compatible: "espressif,esp32-adc"
30
31include: [adc-controller.yaml]
32
33properties:
34
35  unit:
36    type: int
37    required: true
38    description: ADC unit number.
39      Possible values are 1,2,.. depending on chip.
40
41  channel-count:
42    type: int
43    required: true
44    description: The maximum channels supported on each unit.
45
46  "#io-channel-cells":
47    const: 1
48
49io-channel-cells:
50  - input
51