Skip to content

Commit 2c79587

Browse files
committed
refactor(lp_ana_periph): sync the reg names to TRM (part2)
1 parent 2ee7f0e commit 2c79587

File tree

7 files changed

+35
-44
lines changed

7 files changed

+35
-44
lines changed

components/hal/esp32p4/include/hal/touch_sensor_ll.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,10 +755,10 @@ static inline void touch_ll_filter_enable(bool enable)
755755
*/
756756
static inline void touch_ll_force_update_benchmark(uint32_t benchmark)
757757
{
758-
HAL_FORCE_MODIFY_U32_REG_FIELD(LP_ANA_PERI.touch_filter3, touch_baseline_sw, benchmark);
759-
LP_ANA_PERI.touch_filter3.touch_update_baseline_sw = 1;
758+
HAL_FORCE_MODIFY_U32_REG_FIELD(LP_ANA_PERI.touch_filter3, touch_benchmark_sw, benchmark);
759+
LP_ANA_PERI.touch_filter3.touch_update_benchmark_sw = 1;
760760
// waiting for update
761-
while (LP_ANA_PERI.touch_filter3.touch_update_baseline_sw);
761+
while (LP_ANA_PERI.touch_filter3.touch_update_benchmark_sw);
762762
}
763763

764764
/************************ Waterproof register setting ************************/

components/soc/esp32p4/include/soc/lp_analog_peri_reg.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -619,13 +619,13 @@ extern "C" {
619619
* need_des
620620
*/
621621
#define LP_ANALOG_PERI_TOUCH_FILTER1_REG (DR_REG_LP_ANALOG_PERI_BASE + 0x110)
622-
/** LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BASELINE_EN : R/W; bitpos: [0]; default: 0;
622+
/** LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BENCHMARK_EN : R/W; bitpos: [0]; default: 0;
623623
* Reserved
624624
*/
625-
#define LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BASELINE_EN (BIT(0))
626-
#define LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BASELINE_EN_M (LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BASELINE_EN_V << LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BASELINE_EN_S)
627-
#define LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BASELINE_EN_V 0x00000001U
628-
#define LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BASELINE_EN_S 0
625+
#define LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BENCHMARK_EN (BIT(0))
626+
#define LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BENCHMARK_EN_M (LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BENCHMARK_EN_V << LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BENCHMARK_EN_S)
627+
#define LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BENCHMARK_EN_V 0x00000001U
628+
#define LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BENCHMARK_EN_S 0
629629
/** LP_ANALOG_PERI_TOUCH_HYSTERESIS : R/W; bitpos: [2:1]; default: 0;
630630
* need_des
631631
*/
@@ -727,20 +727,20 @@ extern "C" {
727727
* need_des
728728
*/
729729
#define LP_ANALOG_PERI_TOUCH_FILTER3_REG (DR_REG_LP_ANALOG_PERI_BASE + 0x118)
730-
/** LP_ANALOG_PERI_TOUCH_BASELINE_SW : R/W; bitpos: [15:0]; default: 0;
730+
/** LP_ANALOG_PERI_TOUCH_BENCHMARK_SW : R/W; bitpos: [15:0]; default: 0;
731731
* need_des
732732
*/
733-
#define LP_ANALOG_PERI_TOUCH_BASELINE_SW 0x0000FFFFU
734-
#define LP_ANALOG_PERI_TOUCH_BASELINE_SW_M (LP_ANALOG_PERI_TOUCH_BASELINE_SW_V << LP_ANALOG_PERI_TOUCH_BASELINE_SW_S)
735-
#define LP_ANALOG_PERI_TOUCH_BASELINE_SW_V 0x0000FFFFU
736-
#define LP_ANALOG_PERI_TOUCH_BASELINE_SW_S 0
737-
/** LP_ANALOG_PERI_TOUCH_UPDATE_BASELINE_SW : WT; bitpos: [16]; default: 0;
733+
#define LP_ANALOG_PERI_TOUCH_BENCHMARK_SW 0x0000FFFFU
734+
#define LP_ANALOG_PERI_TOUCH_BENCHMARK_SW_M (LP_ANALOG_PERI_TOUCH_BENCHMARK_SW_V << LP_ANALOG_PERI_TOUCH_BENCHMARK_SW_S)
735+
#define LP_ANALOG_PERI_TOUCH_BENCHMARK_SW_V 0x0000FFFFU
736+
#define LP_ANALOG_PERI_TOUCH_BENCHMARK_SW_S 0
737+
/** LP_ANALOG_PERI_TOUCH_UPDATE_BENCHMARK_SW : WT; bitpos: [16]; default: 0;
738738
* need_des
739739
*/
740-
#define LP_ANALOG_PERI_TOUCH_UPDATE_BASELINE_SW (BIT(16))
741-
#define LP_ANALOG_PERI_TOUCH_UPDATE_BASELINE_SW_M (LP_ANALOG_PERI_TOUCH_UPDATE_BASELINE_SW_V << LP_ANALOG_PERI_TOUCH_UPDATE_BASELINE_SW_S)
742-
#define LP_ANALOG_PERI_TOUCH_UPDATE_BASELINE_SW_V 0x00000001U
743-
#define LP_ANALOG_PERI_TOUCH_UPDATE_BASELINE_SW_S 16
740+
#define LP_ANALOG_PERI_TOUCH_UPDATE_BENCHMARK_SW (BIT(16))
741+
#define LP_ANALOG_PERI_TOUCH_UPDATE_BENCHMARK_SW_M (LP_ANALOG_PERI_TOUCH_UPDATE_BENCHMARK_SW_V << LP_ANALOG_PERI_TOUCH_UPDATE_BENCHMARK_SW_S)
742+
#define LP_ANALOG_PERI_TOUCH_UPDATE_BENCHMARK_SW_V 0x00000001U
743+
#define LP_ANALOG_PERI_TOUCH_UPDATE_BENCHMARK_SW_S 16
744744

745745
/** LP_ANALOG_PERI_TOUCH_SLP0_REG register
746746
* need_des

components/soc/esp32p4/include/soc/lp_analog_peri_struct.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,10 @@ typedef union {
510510
*/
511511
typedef union {
512512
struct {
513-
/** touch_nn_disupdate_baseline_en : R/W; bitpos: [0]; default: 0;
513+
/** touch_nn_disupdate_benchmark_en : R/W; bitpos: [0]; default: 0;
514514
* Reserved
515515
*/
516-
uint32_t touch_nn_disupdate_baseline_en:1;
516+
uint32_t touch_nn_disupdate_benchmark_en:1;
517517
/** touch_hysteresis : R/W; bitpos: [2:1]; default: 0;
518518
* need_des
519519
*/
@@ -585,14 +585,14 @@ typedef union {
585585
*/
586586
typedef union {
587587
struct {
588-
/** touch_baseline_sw : R/W; bitpos: [15:0]; default: 0;
588+
/** touch_benchmark_sw : R/W; bitpos: [15:0]; default: 0;
589589
* need_des
590590
*/
591-
uint32_t touch_baseline_sw:16;
592-
/** touch_update_baseline_sw : WT; bitpos: [16]; default: 0;
591+
uint32_t touch_benchmark_sw:16;
592+
/** touch_update_benchmark_sw : WT; bitpos: [16]; default: 0;
593593
* need_des
594594
*/
595-
uint32_t touch_update_baseline_sw:1;
595+
uint32_t touch_update_benchmark_sw:1;
596596
uint32_t reserved_17:15;
597597
};
598598
uint32_t val;
@@ -750,7 +750,7 @@ typedef union {
750750
/** touch_data_sel : R/W; bitpos: [9:8]; default: 0;
751751
* The type of the output data for debugging
752752
* 0/1: raw data
753-
* 2: baseline
753+
* 2: benchmark
754754
* 3: smooth data
755755
*/
756756
uint32_t touch_data_sel:2;

components/soc/esp32s3/include/soc/sens_reg.h

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
// Copyright 2017-2021 Espressif Systems (Shanghai) PTE LTD
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
1+
/*
2+
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
146
#ifndef _SOC_SENS_REG_H_
157
#define _SOC_SENS_REG_H_
168

@@ -602,7 +594,7 @@ extern "C" {
602594
#define SENS_TOUCH_DENOISE_END_V 0x1
603595
#define SENS_TOUCH_DENOISE_END_S 18
604596
/* SENS_TOUCH_DATA_SEL : R/W ;bitpos:[17:16] ;default: 2'd0 ; */
605-
/*description: 3: smooth data 2: baseline 1,0: raw_data.*/
597+
/*description: 3: smooth data 2: benchmark 1,0: raw_data.*/
606598
#define SENS_TOUCH_DATA_SEL 0x00000003
607599
#define SENS_TOUCH_DATA_SEL_M ((SENS_TOUCH_DATA_SEL_V)<<(SENS_TOUCH_DATA_SEL_S))
608600
#define SENS_TOUCH_DATA_SEL_V 0x3
@@ -1378,8 +1370,8 @@ extern "C" {
13781370

13791371
#define SENS_SAR_HALL_CTRL_REG (DR_REG_SENS_BASE + 0xFC)
13801372
/* SENS_HALL_PHASE_FORCE : R/W ;bitpos:[31] ;default: 1'b1 ; */
1381-
/*description: 1: HALL PHASE is controlled by SW 0: HALL PHASE is controlled by FSM in ULP-cop
1382-
rocessor.*/
1373+
/*description: 1: HALL PHASE is controlled by SW 0: HALL PHASE is controlled by FSM in
1374+
ULP-coprocessor.*/
13831375
#define SENS_HALL_PHASE_FORCE (BIT(31))
13841376
#define SENS_HALL_PHASE_FORCE_M (BIT(31))
13851377
#define SENS_HALL_PHASE_FORCE_V 0x1

components/soc/esp32s3/include/soc/sens_struct.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ typedef volatile struct sens_dev_s {
217217
struct {
218218
uint32_t touch_outen : 15; /*touch controller output enable*/
219219
uint32_t touch_status_clr : 1; /*clear all touch active status*/
220-
uint32_t touch_data_sel : 2; /*3: smooth data 2: baseline 1,0: raw_data*/
220+
uint32_t touch_data_sel : 2; /*3: smooth data 2: benchmark 1,0: raw_data*/
221221
uint32_t touch_denoise_end : 1; /*touch_denoise_done*/
222222
uint32_t touch_unit_end : 1; /*touch_unit_done*/
223223
uint32_t touch_approach_pad2 : 4; /*indicate which pad is approach pad2*/

docs/en/api-reference/peripherals/touch_element.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ The Touch Element Wakeup example is available in `system/light_sleep` directory.
443443
444444
// ESP_ERROR_CHECK(touch_element_enable_light_sleep(&sleep_config));
445445
ESP_ERROR_CHECK(touch_element_enable_deep_sleep(button_handle[0], &sleep_config));
446-
// ESP_ERROR_CHECK(touch_element_sleep_enable_wakeup_calibration(button_handle[0], false)); // (optional) Disable wakeup calibration to prevent updating the baseline to a wrong value
446+
// ESP_ERROR_CHECK(touch_element_sleep_enable_wakeup_calibration(button_handle[0], false)); // (optional) Disable wakeup calibration to prevent updating the benchmark to a wrong value
447447
448448
touch_element_start();
449449

tools/ci/check_copyright_ignore.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,6 @@ components/soc/esp32s3/include/soc/rtc_io_reg.h
692692
components/soc/esp32s3/include/soc/rtc_io_struct.h
693693
components/soc/esp32s3/include/soc/sdmmc_pins.h
694694
components/soc/esp32s3/include/soc/sdmmc_reg.h
695-
components/soc/esp32s3/include/soc/sens_reg.h
696695
components/soc/esp32s3/include/soc/sensitive_reg.h
697696
components/soc/esp32s3/include/soc/sensitive_struct.h
698697
components/soc/esp32s3/include/soc/soc_ulp.h

0 commit comments

Comments
 (0)