Merge branch 'fix/touch_h4_p4_typo' into 'master'

fix(touch_sens): fix typo and chip_rev check in H4/P4

See merge request espressif/esp-idf!47586
This commit is contained in:
morris
2026-04-15 10:41:42 +08:00
6 changed files with 7 additions and 16 deletions
@@ -6,7 +6,7 @@
#pragma once
//Touch channels
// Touch channels
#define TOUCH_PAD_GPIO0_CHANNEL 0
#define TOUCH_PAD_NUM0_GPIO_NUM 0
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -314,7 +314,6 @@ static inline uint32_t touch_ll_get_chan_active_threshold(uint32_t touch_num, ui
__attribute__((always_inline))
static inline void touch_ll_enable_scan_mask(uint16_t chan_mask, bool enable)
{
// the lowest bit takes no effect
uint16_t mask = chan_mask & TOUCH_LL_FULL_CHANNEL_MASK;
uint16_t prev_mask = TOUCH_AON.aon_scan_ctrl1.aon_touch_scan_pad_map;
if (enable) {
@@ -333,12 +332,9 @@ static inline void touch_ll_enable_scan_mask(uint16_t chan_mask, bool enable)
* @note The touch sensor that in scan map, should be deinit GPIO function firstly.
* @param enable_mask bitmask of touch sensor scan group.
* e.g. TOUCH_PAD_NUM1 -> BIT(1)
* @return
* - ESP_OK on success
*/
static inline void touch_ll_enable_channel_mask(uint16_t enable_mask)
{
// the lowest bit takes no effect
uint16_t mask = enable_mask & TOUCH_LL_FULL_CHANNEL_MASK;
TOUCH_AON.aon_scan_ctrl1.aon_touch_scan_pad_map = mask;
TOUCH_AON.aon_filter2.aon_touch_outen = mask;
@@ -596,9 +592,7 @@ static inline uint32_t touch_ll_sample_cfg_get_engaged_num(void)
*/
static inline void touch_ll_sample_cfg_set_trigger_rise_cnt(uint8_t rise_cnt)
{
#if HAL_CONFIG(CHIP_SUPPORT_MIN_REV) >= 300
TOUCH_AON.aon_ctrl.aon_freq_scan_cnt_rise = rise_cnt;
#endif
TOUCH_AON.aon_scan_ctrl2.freq_scan_cnt_rise = rise_cnt;
}
/**
@@ -758,7 +752,7 @@ static inline void touch_ll_filter_enable(bool enable)
* Force the update the benchmark by software
* @note This benchmark will be applied to all enabled channel and all sampling frequency
*
* @param pad_num The pad number, range [1-14]
* @param pad_num The pad number, range [0-14]
* @param sample_cfg_id The sample configuration index, range [0-2]
* @param benchmark The benchmark specified by software
*/
@@ -6,7 +6,7 @@
#pragma once
//Touch channels
// Touch channels
/* Note: T14 is an internal channel that does not have a corresponding external GPIO. */
@@ -335,8 +335,6 @@ static inline void touch_ll_enable_scan_mask(uint16_t chan_mask, bool enable)
* @note The touch sensor that in scan map, should be deinit GPIO function firstly.
* @param enable_mask bitmask of touch sensor scan group.
* e.g. TOUCH_PAD_NUM1 -> BIT(1)
* @return
* - ESP_OK on success
*/
static inline void touch_ll_enable_channel_mask(uint16_t enable_mask)
{
@@ -334,7 +334,7 @@ typedef union {
uint32_t val;
} touch_aon_approach_reg_t;
/** Type of aon_freq0_scan_para register
/** Type of aon_freq_scan_para register
* need_des
*/
typedef union {
@@ -481,7 +481,6 @@ typedef union {
uint32_t val;
} touch_aon_date_reg_t;
typedef struct {
volatile touch_aon_threshold_reg_t thresh[3];
} touch_aon_pad_thresh_reg_t;
@@ -254,7 +254,7 @@ typedef union {
uint32_t val;
} touch_aprch_ch_data_reg_t;
/** Type of config register
/** Type of sample_status register
* need_des
*/
typedef union {