#ifndef _WS_RTC_H_ #define _WS_RTC_H_ #include #include #include #include #include "WS_GPIO.h" #include "WS_Information.h" extern bool Relay_Flag[6]; // Relay current status flag #define RTC_Flag 1 // RTC Timing Switcher flag // #define RTC_OPEN_Time_Hour 16 // Time when the timing switch is enabled // #define RTC_OPEN_Time_Min 29 // Time when the timing switch is enabled // #define RTC_Closs_Time_Hour 16 // Time when the timing switch is off // #define RTC_Closs_Time_Min 30 // Time when the timing switch is off #define DS3231_I2C_ADDR 0x68 #define I2C_SDA 4 #define I2C_SCL 5 #define RTC_OPEN_Hour (RTC_OPEN_Time_Hour%10 + RTC_OPEN_Time_Hour /10*16) // RTC Timing Switcher flag #define RTC_OPEN_Min (RTC_OPEN_Time_Min%10 + RTC_OPEN_Time_Min /10*16) // RTC Timing Switcher flag #define RTC_Closs_Hour (RTC_Closs_Time_Hour%10 + RTC_Closs_Time_Hour /10*16) // RTC Timing Switcher flag #define RTC_Closs_Min (RTC_Closs_Time_Min%10 + RTC_Closs_Time_Min /10*16) // RTC Timing Switcher flag void RTC_Init(); void DS3231_ReadTime() ; void DS3231_SetTime(uint8_t sec, uint8_t min, uint8_t hour, uint8_t dayOfWeek, uint8_t day, uint8_t month, uint8_t year); uint8_t DecToBcd(uint8_t val); void Acquisition_time(); void RTC_Loop(); #endif