diff --git a/components/hal/esp32/include/hal/touch_sensor_ll.h b/components/hal/esp32/include/hal/touch_sensor_ll.h index 21850c9b97..b93c7b873a 100644 --- a/components/hal/esp32/include/hal/touch_sensor_ll.h +++ b/components/hal/esp32/include/hal/touch_sensor_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -206,7 +206,12 @@ static inline void touch_ll_get_slope(touch_pad_t touch_num, touch_cnt_slope_t * static inline void touch_ll_set_tie_option(touch_pad_t touch_num, touch_tie_opt_t opt) { touch_pad_t touch_pad_wrap = touch_ll_num_wrap(touch_num); - RTCIO.touch_pad[touch_pad_wrap].tie_opt = opt; + if (opt == TOUCH_PAD_TIE_OPT_FLOAT) { + RTCIO.touch_pad[touch_pad_wrap].xpd = 0; + } else { + RTCIO.touch_pad[touch_pad_wrap].xpd = 1; + RTCIO.touch_pad[touch_pad_wrap].tie_opt = opt; + } } /** @@ -218,7 +223,11 @@ static inline void touch_ll_set_tie_option(touch_pad_t touch_num, touch_tie_opt_ static inline void touch_ll_get_tie_option(touch_pad_t touch_num, touch_tie_opt_t *opt) { touch_pad_t touch_pad_wrap = touch_ll_num_wrap(touch_num); - *opt = (touch_tie_opt_t)RTCIO.touch_pad[touch_pad_wrap].tie_opt; + if (RTCIO.touch_pad[touch_pad_wrap].xpd) { + *opt = (touch_tie_opt_t)RTCIO.touch_pad[touch_pad_wrap].tie_opt; + } else { + *opt = TOUCH_PAD_TIE_OPT_FLOAT; + } } /** diff --git a/components/hal/esp32s2/include/hal/touch_sensor_ll.h b/components/hal/esp32s2/include/hal/touch_sensor_ll.h index 62072a5856..d11e8c0eeb 100644 --- a/components/hal/esp32s2/include/hal/touch_sensor_ll.h +++ b/components/hal/esp32s2/include/hal/touch_sensor_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -192,7 +192,12 @@ static inline void touch_ll_get_slope(touch_pad_t touch_num, touch_cnt_slope_t * */ static inline void touch_ll_set_tie_option(touch_pad_t touch_num, touch_tie_opt_t opt) { - RTCIO.touch_pad[touch_num].tie_opt = opt; + if (opt == TOUCH_PAD_TIE_OPT_FLOAT) { + RTCIO.touch_pad[touch_num].xpd = 0; + } else { + RTCIO.touch_pad[touch_num].xpd = 1; + RTCIO.touch_pad[touch_num].tie_opt = opt; + } } /** @@ -203,7 +208,11 @@ static inline void touch_ll_set_tie_option(touch_pad_t touch_num, touch_tie_opt_ */ static inline void touch_ll_get_tie_option(touch_pad_t touch_num, touch_tie_opt_t *opt) { - *opt = (touch_tie_opt_t)RTCIO.touch_pad[touch_num].tie_opt; + if (RTCIO.touch_pad[touch_num].xpd) { + *opt = (touch_tie_opt_t)RTCIO.touch_pad[touch_num].tie_opt; + } else { + *opt = TOUCH_PAD_TIE_OPT_FLOAT; + } } /** diff --git a/components/hal/esp32s3/include/hal/touch_sensor_ll.h b/components/hal/esp32s3/include/hal/touch_sensor_ll.h index 5803b0a2c9..871c9d3f36 100644 --- a/components/hal/esp32s3/include/hal/touch_sensor_ll.h +++ b/components/hal/esp32s3/include/hal/touch_sensor_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -200,7 +200,12 @@ static inline void touch_ll_get_slope(touch_pad_t touch_num, touch_cnt_slope_t * */ static inline void touch_ll_set_tie_option(touch_pad_t touch_num, touch_tie_opt_t opt) { - RTCIO.touch_pad[touch_num].tie_opt = opt; + if (opt == TOUCH_PAD_TIE_OPT_FLOAT) { + RTCIO.touch_pad[touch_num].xpd = 0; + } else { + RTCIO.touch_pad[touch_num].xpd = 1; + RTCIO.touch_pad[touch_num].tie_opt = opt; + } } /** @@ -211,7 +216,11 @@ static inline void touch_ll_set_tie_option(touch_pad_t touch_num, touch_tie_opt_ */ static inline void touch_ll_get_tie_option(touch_pad_t touch_num, touch_tie_opt_t *opt) { - *opt = (touch_tie_opt_t)RTCIO.touch_pad[touch_num].tie_opt; + if (RTCIO.touch_pad[touch_num].xpd) { + *opt = (touch_tie_opt_t)RTCIO.touch_pad[touch_num].tie_opt; + } else { + *opt = TOUCH_PAD_TIE_OPT_FLOAT; + } } /** diff --git a/components/hal/include/hal/touch_sensor_types.h b/components/hal/include/hal/touch_sensor_types.h index 46e0d967ca..df6237a2d1 100644 --- a/components/hal/include/hal/touch_sensor_types.h +++ b/components/hal/include/hal/touch_sensor_types.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -86,7 +86,8 @@ typedef enum { typedef enum { TOUCH_PAD_TIE_OPT_LOW = 0, /*!