mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
refactor(lp_ana_periph): sync the reg names to TRM
This commit is contained in:
parent
96e370f9bb
commit
a775317091
@ -724,10 +724,10 @@ static inline void touch_ll_filter_set_neg_noise_thresh(int neg_noise_thresh, ui
|
||||
{
|
||||
bool always_update = neg_noise_thresh == -1;
|
||||
bool stop_update = neg_noise_thresh == -2;
|
||||
LP_ANA_PERI.touch_filter2.touch_bypass_neg_noise_thres = always_update;
|
||||
LP_ANA_PERI.touch_filter1.touch_neg_noise_disupdate_baseline_en = stop_update;
|
||||
LP_ANA_PERI.touch_filter1.touch_neg_noise_thres = always_update || stop_update ? 0 : neg_noise_thresh;
|
||||
LP_ANA_PERI.touch_filter1.touch_neg_noise_limit = always_update || stop_update ? 5 : neg_noise_limit; // 5 is the default value
|
||||
LP_ANA_PERI.touch_filter2.touch_bypass_nn_thres = always_update;
|
||||
LP_ANA_PERI.touch_filter1.touch_nn_disupdate_baseline_en = stop_update;
|
||||
LP_ANA_PERI.touch_filter1.touch_nn_thres = always_update || stop_update ? 0 : neg_noise_thresh;
|
||||
LP_ANA_PERI.touch_filter1.touch_nn_limit = always_update || stop_update ? 5 : neg_noise_limit; // 5 is the default value
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -619,13 +619,13 @@ extern "C" {
|
||||
* need_des
|
||||
*/
|
||||
#define LP_ANALOG_PERI_TOUCH_FILTER1_REG (DR_REG_LP_ANALOG_PERI_BASE + 0x110)
|
||||
/** LP_ANALOG_PERI_TOUCH_NEG_NOISE_DISUPDATE_BASELINE_EN : R/W; bitpos: [0]; default: 0;
|
||||
/** LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BASELINE_EN : R/W; bitpos: [0]; default: 0;
|
||||
* Reserved
|
||||
*/
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_DISUPDATE_BASELINE_EN (BIT(0))
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_DISUPDATE_BASELINE_EN_M (LP_ANALOG_PERI_TOUCH_NEG_NOISE_DISUPDATE_BASELINE_EN_V << LP_ANALOG_PERI_TOUCH_NEG_NOISE_DISUPDATE_BASELINE_EN_S)
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_DISUPDATE_BASELINE_EN_V 0x00000001U
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_DISUPDATE_BASELINE_EN_S 0
|
||||
#define LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BASELINE_EN (BIT(0))
|
||||
#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)
|
||||
#define LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BASELINE_EN_V 0x00000001U
|
||||
#define LP_ANALOG_PERI_TOUCH_NN_DISUPDATE_BASELINE_EN_S 0
|
||||
/** LP_ANALOG_PERI_TOUCH_HYSTERESIS : R/W; bitpos: [2:1]; default: 0;
|
||||
* need_des
|
||||
*/
|
||||
@ -633,13 +633,13 @@ extern "C" {
|
||||
#define LP_ANALOG_PERI_TOUCH_HYSTERESIS_M (LP_ANALOG_PERI_TOUCH_HYSTERESIS_V << LP_ANALOG_PERI_TOUCH_HYSTERESIS_S)
|
||||
#define LP_ANALOG_PERI_TOUCH_HYSTERESIS_V 0x00000003U
|
||||
#define LP_ANALOG_PERI_TOUCH_HYSTERESIS_S 1
|
||||
/** LP_ANALOG_PERI_TOUCH_NEG_NOISE_THRES : R/W; bitpos: [4:3]; default: 0;
|
||||
/** LP_ANALOG_PERI_TOUCH_NN_THRES : R/W; bitpos: [4:3]; default: 0;
|
||||
* need_des
|
||||
*/
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_THRES 0x00000003U
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_THRES_M (LP_ANALOG_PERI_TOUCH_NEG_NOISE_THRES_V << LP_ANALOG_PERI_TOUCH_NEG_NOISE_THRES_S)
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_THRES_V 0x00000003U
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_THRES_S 3
|
||||
#define LP_ANALOG_PERI_TOUCH_NN_THRES 0x00000003U
|
||||
#define LP_ANALOG_PERI_TOUCH_NN_THRES_M (LP_ANALOG_PERI_TOUCH_NN_THRES_V << LP_ANALOG_PERI_TOUCH_NN_THRES_S)
|
||||
#define LP_ANALOG_PERI_TOUCH_NN_THRES_V 0x00000003U
|
||||
#define LP_ANALOG_PERI_TOUCH_NN_THRES_S 3
|
||||
/** LP_ANALOG_PERI_TOUCH_NOISE_THRES : R/W; bitpos: [6:5]; default: 0;
|
||||
* need_des
|
||||
*/
|
||||
@ -675,13 +675,13 @@ extern "C" {
|
||||
#define LP_ANALOG_PERI_TOUCH_FILTER_EN_M (LP_ANALOG_PERI_TOUCH_FILTER_EN_V << LP_ANALOG_PERI_TOUCH_FILTER_EN_S)
|
||||
#define LP_ANALOG_PERI_TOUCH_FILTER_EN_V 0x00000001U
|
||||
#define LP_ANALOG_PERI_TOUCH_FILTER_EN_S 16
|
||||
/** LP_ANALOG_PERI_TOUCH_NEG_NOISE_LIMIT : R/W; bitpos: [20:17]; default: 5;
|
||||
/** LP_ANALOG_PERI_TOUCH_NN_LIMIT : R/W; bitpos: [20:17]; default: 5;
|
||||
* need_des
|
||||
*/
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_LIMIT 0x0000000FU
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_LIMIT_M (LP_ANALOG_PERI_TOUCH_NEG_NOISE_LIMIT_V << LP_ANALOG_PERI_TOUCH_NEG_NOISE_LIMIT_S)
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_LIMIT_V 0x0000000FU
|
||||
#define LP_ANALOG_PERI_TOUCH_NEG_NOISE_LIMIT_S 17
|
||||
#define LP_ANALOG_PERI_TOUCH_NN_LIMIT 0x0000000FU
|
||||
#define LP_ANALOG_PERI_TOUCH_NN_LIMIT_M (LP_ANALOG_PERI_TOUCH_NN_LIMIT_V << LP_ANALOG_PERI_TOUCH_NN_LIMIT_S)
|
||||
#define LP_ANALOG_PERI_TOUCH_NN_LIMIT_V 0x0000000FU
|
||||
#define LP_ANALOG_PERI_TOUCH_NN_LIMIT_S 17
|
||||
/** LP_ANALOG_PERI_TOUCH_APPROACH_LIMIT : R/W; bitpos: [28:21]; default: 80;
|
||||
* need_des
|
||||
*/
|
||||
@ -715,13 +715,13 @@ extern "C" {
|
||||
#define LP_ANALOG_PERI_TOUCH_BYPASS_NOISE_THRES_M (LP_ANALOG_PERI_TOUCH_BYPASS_NOISE_THRES_V << LP_ANALOG_PERI_TOUCH_BYPASS_NOISE_THRES_S)
|
||||
#define LP_ANALOG_PERI_TOUCH_BYPASS_NOISE_THRES_V 0x00000001U
|
||||
#define LP_ANALOG_PERI_TOUCH_BYPASS_NOISE_THRES_S 30
|
||||
/** LP_ANALOG_PERI_TOUCH_BYPASS_NEG_NOISE_THRES : R/W; bitpos: [31]; default: 0;
|
||||
/** LP_ANALOG_PERI_TOUCH_BYPASS_NN_THRES : R/W; bitpos: [31]; default: 0;
|
||||
* need_des
|
||||
*/
|
||||
#define LP_ANALOG_PERI_TOUCH_BYPASS_NEG_NOISE_THRES (BIT(31))
|
||||
#define LP_ANALOG_PERI_TOUCH_BYPASS_NEG_NOISE_THRES_M (LP_ANALOG_PERI_TOUCH_BYPASS_NEG_NOISE_THRES_V << LP_ANALOG_PERI_TOUCH_BYPASS_NEG_NOISE_THRES_S)
|
||||
#define LP_ANALOG_PERI_TOUCH_BYPASS_NEG_NOISE_THRES_V 0x00000001U
|
||||
#define LP_ANALOG_PERI_TOUCH_BYPASS_NEG_NOISE_THRES_S 31
|
||||
#define LP_ANALOG_PERI_TOUCH_BYPASS_NN_THRES (BIT(31))
|
||||
#define LP_ANALOG_PERI_TOUCH_BYPASS_NN_THRES_M (LP_ANALOG_PERI_TOUCH_BYPASS_NN_THRES_V << LP_ANALOG_PERI_TOUCH_BYPASS_NN_THRES_S)
|
||||
#define LP_ANALOG_PERI_TOUCH_BYPASS_NN_THRES_V 0x00000001U
|
||||
#define LP_ANALOG_PERI_TOUCH_BYPASS_NN_THRES_S 31
|
||||
|
||||
/** LP_ANALOG_PERI_TOUCH_FILTER3_REG register
|
||||
* need_des
|
||||
|
@ -510,18 +510,18 @@ typedef union {
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** touch_neg_noise_disupdate_baseline_en : R/W; bitpos: [0]; default: 0;
|
||||
/** touch_nn_disupdate_baseline_en : R/W; bitpos: [0]; default: 0;
|
||||
* Reserved
|
||||
*/
|
||||
uint32_t touch_neg_noise_disupdate_baseline_en:1;
|
||||
uint32_t touch_nn_disupdate_baseline_en:1;
|
||||
/** touch_hysteresis : R/W; bitpos: [2:1]; default: 0;
|
||||
* need_des
|
||||
*/
|
||||
uint32_t touch_hysteresis:2;
|
||||
/** touch_neg_noise_thres : R/W; bitpos: [4:3]; default: 0;
|
||||
/** touch_nn_thres : R/W; bitpos: [4:3]; default: 0;
|
||||
* need_des
|
||||
*/
|
||||
uint32_t touch_neg_noise_thres:2;
|
||||
uint32_t touch_nn_thres:2;
|
||||
/** touch_noise_thres : R/W; bitpos: [6:5]; default: 0;
|
||||
* need_des
|
||||
*/
|
||||
@ -542,10 +542,10 @@ typedef union {
|
||||
* need_des
|
||||
*/
|
||||
uint32_t touch_filter_en:1;
|
||||
/** touch_neg_noise_limit : R/W; bitpos: [20:17]; default: 5;
|
||||
/** touch_nn_limit : R/W; bitpos: [20:17]; default: 5;
|
||||
* need_des
|
||||
*/
|
||||
uint32_t touch_neg_noise_limit:4;
|
||||
uint32_t touch_nn_limit:4;
|
||||
/** touch_approach_limit : R/W; bitpos: [28:21]; default: 80;
|
||||
* need_des
|
||||
*/
|
||||
@ -572,10 +572,10 @@ typedef union {
|
||||
* need_des
|
||||
*/
|
||||
uint32_t touch_bypass_noise_thres:1;
|
||||
/** touch_bypass_neg_noise_thres : R/W; bitpos: [31]; default: 0;
|
||||
/** touch_bypass_nn_thres : R/W; bitpos: [31]; default: 0;
|
||||
* need_des
|
||||
*/
|
||||
uint32_t touch_bypass_neg_noise_thres:1;
|
||||
uint32_t touch_bypass_nn_thres:1;
|
||||
};
|
||||
uint32_t val;
|
||||
} lp_analog_peri_touch_filter2_reg_t;
|
||||
|
Loading…
Reference in New Issue
Block a user