// // Created by EDZ on 25-9-16. // #ifndef RTC_SLEEP_H #define RTC_SLEEP_H #include #include #include "string.h" #include "E52.h" #include "E104-BT5005A.h" // 定义结构体一个结构体用于存储读取到的日期时间 typedef struct { uint8_t hours; uint8_t minutes; uint8_t seconds; uint8_t weekday; uint8_t month; uint8_t date; uint8_t year; } RTC_DateTimeTypeDef; typedef struct { RTC_DateTimeTypeDef startTime; // 按下时的完整RTC时间 uint32_t key_Duration; // 按压持续时长 (秒),改成32位 uint8_t key_Count; // 按键次数(可选) uint8_t key_CheckActive; // 是否正在检测中 } RTC_key_struct; extern RTC_DateTimeTypeDef firstPressTime; extern RTC_key_struct SOS_key_struct; extern RTC_key_struct JUGE_key_struct; void RTC_GetDateTime(RTC_HandleTypeDef *hrtc, RTC_DateTimeTypeDef *datetime); void RTC_SetDateTime(RTC_HandleTypeDef *hrtc, uint8_t hours, uint8_t minutes, uint8_t seconds, uint8_t weekday, uint8_t month, uint8_t date, uint8_t year); void RTC_Sleep_Enter_Fun(void); #endif //RTC_SLEEP_H