我的代码如下,一进入睡眠就直接被唤醒。我的触摸引脚是IO1
void touch_sleep_init() {
// gpio_reset_pin(SLEEP_GPIO);
touch_pad_fsm_stop();
touch_pad_init();
touch_pad_io_init(TOUCH_PIN);
// uint16_t enable_mask = BIT(14);
// touch_pad_set_channel_mask(BIT(14));
// touch_pad_set_voltage(TOUCH_HVOLT_2V7, TOUCH_LVOLT_0V5, TOUCH_HVOLT_ATTEN_1V);
touch_pad_config(TOUCH_PIN);
//touch_pad_filter_enble();
// touch_pad_set_thresh(TOUCH_PIN,400);
// uint32_t benchmark_value;
// touch_pad_read_benchmark(TOUCH_PIN, &benchmark_value);
// touch_pad_set_thresh(TOUCH_PIN,300);
// ESP_LOGI("benmark", "GPIO %d level: %lu",GPIO_NUM_1, benchmark_value);
uint16_t enable_mask_get;
touch_pad_get_channel_mask(&enable_mask_get);
ESP_LOGI("_enable_mark", "enable_mask: %u",enable_mask_get);
// touch_filter_config_t filter_info={
// .jitter_step=8,
// };
// touch_pad_filter_set_config(&filter_info);
//touch_pad_set_thresh(TOUCH_PIN,100000);
// touch_pad_fsm_start();
// touch_pad_isr_register(isr_touch_handle, NULL,TOUCH_PAD_INTR_MASK_DONE);
// touch_pad_intr_enable(TOUCH_PAD_INTR_MASK_SCAN_DONE);
touch_pad_isr_register(isr_touch_handle, NULL,TOUCH_PAD_INTR_MASK_SCAN_DONE);
touch_pad_set_measurement_interval(150);
touch_pad_intr_enable(TOUCH_PAD_INTR_MASK_SCAN_DONE);
touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER);
touch_pad_fsm_start();
esp_err_t ret = esp_sleep_enable_touchpad_wakeup();
if (ret == ESP_OK) {
ESP_LOGI("touch_wakeup_enable","OK");
} else if (ret == ESP_ERR_NOT_SUPPORTED) {
ESP_LOGI("touch_wakeup_enable","ESP_PD_OPTION_ON");
} else if (ret == ESP_ERR_INVALID_STATE) {
ESP_LOGI("touch_wakeup_enable","Other wakeup source existed");
}
}
esp32s3如何通过IDF设置触摸唤醒,
-
- Posts: 2
- Joined: Thu Oct 31, 2024 4:18 am
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: No registered users and 159 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.