user_sleep.h 1.1 KB

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