Merge branch 'bugfix/touch_sensor_reading_error_in_light_sleep_process' into 'master'

driver(touch): fix touch sensor false trigger in sleep mode

See merge request espressif/esp-idf!10983
This commit is contained in:
Michael (XIAO Xufeng)
2020-12-14 14:51:51 +08:00
3 changed files with 50 additions and 29 deletions

View File

@@ -289,6 +289,17 @@ static inline void touch_ll_stop_fsm(void)
RTCCNTL.touch_ctrl2.touch_timer_force_done = TOUCH_LL_TIMER_DONE;
}
/**
* Get touch sensor FSM timer state.
* @return
* - true: FSM enabled
* - false: FSM disabled
*/
static inline bool touch_ll_get_fsm_state(void)
{
return (bool)RTCCNTL.touch_ctrl2.touch_slp_timer_en;
}
/**
* Trigger a touch sensor measurement, only support in SW mode of FSM.
*/
@@ -298,18 +309,12 @@ static inline void touch_ll_start_sw_meas(void)
RTCCNTL.touch_ctrl2.touch_start_en = 1;
}
/**
* Set touch sensor interrupt threshold.
*
* @param touch_num touch pad index.
* @param threshold threshold of touchpad count.
*/
/**
* Set the trigger threshold of touch sensor.
* The threshold determines the sensitivity of the touch sensor.
* The threshold is the original value of the trigger state minus the benchmark value.
*
* @note If set "TOUCH_PAD_THRESHOLD_MAX", the touch is never be trigered.
* @note If set "TOUCH_PAD_THRESHOLD_MAX", the touch is never be triggered.
* @param touch_num touch pad index
* @param threshold threshold of touch sensor.
*/