user_sleep.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef __USER_SLEEP_H__
  2. #define __USER_SLEEP_H__
  3. #define TIMER_WAKEUP_TIME_US (30 * 1000 * 1000) //定义的唤醒的时间 单位s
  4. #define TIMER_CAN_SEND_TIME (200) //定义可以唤醒lora工作的时间单位ms
  5. #define LORA_POWER_TIME (2000)
  6. //睡眠关闭电源使能
  7. #define LORA_SLEEP_ENABLE 1 //使能LORA关闭电源
  8. #define FONT_SLEEP_ENABLE 1 //使能字库关闭电源
  9. #define LCD_SLEEP_ENABLE 0 //使能LCD关闭电源
  10. #define USER_LIGHT_SLEEP_ENABLE 1 //使能深度睡眠
  11. #define USER_DEEP_SLEEP_ENABLE 0 //使能深度睡眠
  12. #define USER_NOT_SLEEP_ENABLE 0 //使能禁止休眠模式
  13. void user_sleep_into();
  14. #include "esp_err.h"
  15. esp_err_t example_register_timer_wakeup(void);
  16. extern uint8_t _wakeup_reson; //内存上次唤醒的原因
  17. int is_wake_up_reson(); //返回唤醒的原因
  18. void sleep_timer_start(int ms);
  19. void sleep_timer_stop(void);
  20. void Already_send_timer_start(int ms);
  21. void Already_send_timer_stop(void);
  22. int left_adc_wake_btn_send();
  23. #endif