RTC_SLEEP.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // Created by EDZ on 25-9-16.
  3. //
  4. #ifndef RTC_SLEEP_H
  5. #define RTC_SLEEP_H
  6. #include <time.h>
  7. #include <stdlib.h>
  8. #include "string.h"
  9. #include "E52.h"
  10. #include "E104-BT5005A.h"
  11. // 定义结构体一个结构体用于存储读取到的日期时间
  12. typedef struct {
  13. uint8_t hours;
  14. uint8_t minutes;
  15. uint8_t seconds;
  16. uint8_t weekday;
  17. uint8_t month;
  18. uint8_t date;
  19. uint8_t year;
  20. } RTC_DateTimeTypeDef;
  21. typedef struct {
  22. RTC_DateTimeTypeDef startTime; // 按下时的完整RTC时间
  23. uint32_t key_Duration; // 按压持续时长 (秒),改成32位
  24. uint8_t key_Count; // 按键次数(可选)
  25. uint8_t key_CheckActive; // 是否正在检测中
  26. } RTC_key_struct;
  27. extern RTC_DateTimeTypeDef firstPressTime;
  28. extern RTC_key_struct SOS_key_struct;
  29. extern RTC_key_struct JUGE_key_struct;
  30. void RTC_GetDateTime(RTC_HandleTypeDef *hrtc, RTC_DateTimeTypeDef *datetime);
  31. void RTC_SetDateTime(RTC_HandleTypeDef *hrtc, uint8_t hours, uint8_t minutes, uint8_t seconds,
  32. uint8_t weekday, uint8_t month, uint8_t date, uint8_t year);
  33. void RTC_Sleep_Enter_Fun(void);
  34. #endif //RTC_SLEEP_H