Merge branch 'bugfix/reduce_the_consumption_of_touch_sensor_during_deep_sleep_backport_v4.3' into 'release/v4.3'

bugfix: reduce the consumption of touch sensor during deep sleep (backport v4.3)

See merge request espressif/esp-idf!12869
This commit is contained in:
Michael (XIAO Xufeng)
2021-04-13 04:16:01 +00:00
11 changed files with 181 additions and 31 deletions

View File

@@ -608,6 +608,33 @@ void touch_hal_sleep_channel_enable(touch_pad_t pad_num, bool enable);
*/
#define touch_hal_get_wakeup_status(pad_num) touch_ll_get_wakeup_status(pad_num)
/**
* Change the operating frequency of touch pad in deep sleep state. Reducing the operating frequency can effectively reduce power consumption.
* If this function is not called, the working frequency of touch in the deep sleep state is the same as that in the wake-up state.
*
* @param sleep_cycle The touch sensor will sleep after each measurement.
* sleep_cycle decide the interval between each measurement.
* t_sleep = sleep_cycle / (RTC_SLOW_CLK frequency).
* The approximate frequency value of RTC_SLOW_CLK can be obtained using rtc_clk_slow_freq_get_hz function.
* @param meas_times The times of charge and discharge in each measure process of touch channels.
* The timer frequency is 8Mhz. Range: 0 ~ 0xffff.
* Recommended typical value: Modify this value to make the measurement time around 1ms.
*/
void touch_hal_sleep_channel_set_work_time(uint16_t sleep_cycle, uint16_t meas_times);
/**
* Get the operating frequency of touch pad in deep sleep state. Reducing the operating frequency can effectively reduce power consumption.
*
* @param sleep_cycle The touch sensor will sleep after each measurement.
* sleep_cycle decide the interval between each measurement.
* t_sleep = sleep_cycle / (RTC_SLOW_CLK frequency).
* The approximate frequency value of RTC_SLOW_CLK can be obtained using rtc_clk_slow_freq_get_hz function.
* @param meas_times The times of charge and discharge in each measure process of touch channels.
* The timer frequency is 8Mhz. Range: 0 ~ 0xffff.
* Recommended typical value: Modify this value to make the measurement time around 1ms.
*/
void touch_hal_sleep_channel_get_work_time(uint16_t *sleep_cycle, uint16_t *meas_times);
#ifdef __cplusplus
}
#endif