// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #pragma once #include "soc/touch_sensor_caps.h" #include "sdkconfig.h" #include "esp_attr.h" /** Touch pad channel */ typedef enum { TOUCH_PAD_NUM0 = 0, /*!< Touch pad channel 0 is GPIO4(ESP32) */ TOUCH_PAD_NUM1, /*!< Touch pad channel 1 is GPIO0(ESP32) / GPIO1(ESP32-S2) */ TOUCH_PAD_NUM2, /*!< Touch pad channel 2 is GPIO2(ESP32) / GPIO2(ESP32-S2) */ TOUCH_PAD_NUM3, /*!< Touch pad channel 3 is GPIO15(ESP32) / GPIO3(ESP32-S2) */ TOUCH_PAD_NUM4, /*!< Touch pad channel 4 is GPIO13(ESP32) / GPIO4(ESP32-S2) */ TOUCH_PAD_NUM5, /*!< Touch pad channel 5 is GPIO12(ESP32) / GPIO5(ESP32-S2) */ TOUCH_PAD_NUM6, /*!< Touch pad channel 6 is GPIO14(ESP32) / GPIO6(ESP32-S2) */ TOUCH_PAD_NUM7, /*!< Touch pad channel 7 is GPIO27(ESP32) / GPIO7(ESP32-S2) */ TOUCH_PAD_NUM8, /*!< Touch pad channel 8 is GPIO33(ESP32) / GPIO8(ESP32-S2) */ TOUCH_PAD_NUM9, /*!< Touch pad channel 9 is GPIO32(ESP32) / GPIO9(ESP32-S2) */ #if SOC_TOUCH_SENSOR_NUM > 10 TOUCH_PAD_NUM10, /*!< Touch channel 10 is GPIO10(ESP32-S2) */ TOUCH_PAD_NUM11, /*!< Touch channel 11 is GPIO11(ESP32-S2) */ TOUCH_PAD_NUM12, /*!< Touch channel 12 is GPIO12(ESP32-S2) */ TOUCH_PAD_NUM13, /*!< Touch channel 13 is GPIO13(ESP32-S2) */ TOUCH_PAD_NUM14, /*!< Touch channel 14 is GPIO14(ESP32-S2) */ #endif TOUCH_PAD_MAX, } touch_pad_t; /** Touch sensor high reference voltage */ typedef enum { TOUCH_HVOLT_KEEP = -1, /*! (touch threshold + hysteresis), the touch channel be touched. If (raw data - baseline) < (touch threshold - hysteresis), the touch channel be released. Range: 0 ~ 3. The coefficient is 0: 4/32; 1: 3/32; 2: 1/32; 3: OFF */ uint32_t noise_thr; /*! (noise), the baseline stop updating. If (raw data - baseline) < (noise), the baseline start updating. Range: 0 ~ 3. The coefficient is 0: 4/8; 1: 3/8; 2: 2/8; 3: 1; */ uint32_t noise_neg_thr; /*! (negative noise), the baseline restart reset process(refer to `baseline_reset`). If (baseline - raw data) < (negative noise), the baseline stop reset process(refer to `baseline_reset`). Range: 0 ~ 3. The coefficient is 0: 4/8; 1: 3/8; 2: 2/8; 3: 1/8; */ uint32_t neg_noise_limit; /*!