#pragma once #include "soc/adc_caps.h" #include "sdkconfig.h" #include /** * @brief ADC units selected handle. * * @note For ADC digital controller(DMA mode), ESP32 don't support `ADC_UNIT_2`, `ADC_UNIT_BOTH`, `ADC_UNIT_ALTER`. */ typedef enum { ADC_UNIT_1 = 1, /*!< SAR ADC 1. */ ADC_UNIT_2 = 2, /*!< SAR ADC 2. */ ADC_UNIT_BOTH = 3, /*!< SAR ADC 1 and 2. */ ADC_UNIT_ALTER = 7, /*!< SAR ADC 1 and 2 alternative mode. */ ADC_UNIT_MAX, } adc_unit_t; /** * @brief ADC channels handle. See ``adc1_channel_t``, ``adc2_channel_t``. * * @note For ESP32 ADC1, don't support `ADC_CHANNEL_8`, `ADC_CHANNEL_9`. See ``adc1_channel_t``. */ typedef enum { ADC_CHANNEL_0 = 0, /*!< ADC channel */ ADC_CHANNEL_1, /*!< ADC channel */ ADC_CHANNEL_2, /*!< ADC channel */ ADC_CHANNEL_3, /*!< ADC channel */ ADC_CHANNEL_4, /*!< ADC channel */ ADC_CHANNEL_5, /*!< ADC channel */ ADC_CHANNEL_6, /*!< ADC channel */ ADC_CHANNEL_7, /*!< ADC channel */ ADC_CHANNEL_8, /*!< ADC channel */ ADC_CHANNEL_9, /*!< ADC channel */ ADC_CHANNEL_MAX, } adc_channel_t; /** * @brief ADC attenuation parameter. Different parameters determine the range of the ADC. See ``adc1_config_channel_atten``. */ typedef enum { ADC_ATTEN_DB_0 = 0, /*! ADC_CHANNEL_MAX), The data is invalid. */ } type1; /*! ADC_CHANNEL_MAX), The data is invalid. */ uint16_t unit: 1; /*! threshold, Generates monitor interrupt. * MONITOR_LOW: If ADC_OUT < threshold, Generates monitor interrupt. */ typedef enum { ADC_DIGI_MONITOR_HIGH = 0, /*! threshold, Generates monitor interrupt. */ ADC_DIGI_MONITOR_LOW, /*!