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

This commit is contained in:
fuzhibo
2020-10-26 16:10:37 +08:00
parent 49022d4d92
commit 985e94139d
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.
*/