rtc.h 858 B

1234567891011121314151617181920212223242526272829
  1. /************************************RTC.h文件***************************/
  2. #ifndef __RTC_H
  3. #define __RTC_H
  4. //时间结构体
  5. typedef struct
  6. {
  7. vu8 hour;
  8. vu8 min;
  9. vu8 sec;
  10. //公历日月年周
  11. vu16 w_year;
  12. vu8 w_month;
  13. vu8 w_date;
  14. vu8 week;
  15. }_calendar_obj;
  16. extern _calendar_obj calendar; //日历结构体
  17. extern u8 const mon_table[12]; //月份日期数据表
  18. void Disp_Time(u8 x,u8 y,u8 size);//在制定位置开始显示时间
  19. void Disp_Week(u8 x,u8 y,u8 size,u8 lang);//在指定位置显示星期
  20. u8 RTC_Init(void); //初始化RTC,返回0,失败;1,成功;
  21. u8 Is_Leap_Year(u16 year);//平年,闰年判断
  22. u8 RTC_Alarm_Set(u16 syear,u8 smon,u8 sday,u8 hour,u8 min,u8 sec);
  23. u8 RTC_Get(void); //更新时间
  24. u8 RTC_Get_Week(u16 year,u8 month,u8 day);
  25. u8 RTC_Set(u16 syear,u8 smon,u8 sday,u8 hour,u8 min,u8 sec);//设置时间
  26. void RTC_Set_Stamp(uint32_t seccount);
  27. #endif