app_rtc.h 458 B

12345678910111213141516171819202122
  1. #ifndef __app_rtc_h__
  2. #define __app_rtc_h__
  3. #include "stdint.h"
  4. // 说明,时间格式统一为BCD格式
  5. typedef struct
  6. {
  7. uint8_t tm_year;
  8. uint8_t tm_mon;
  9. uint8_t tm_mday;
  10. uint8_t tm_hour;
  11. uint8_t tm_min;
  12. uint8_t tm_sec;
  13. } rtc_time_t;
  14. extern int rtc_get_time(rtc_time_t *time);
  15. extern int rtc_set_time(rtc_time_t *time);
  16. extern uint32_t rtc_mktime(rtc_time_t *tim);
  17. extern void rtc_gmtime(rtc_time_t *dt, uint32_t time);
  18. #endif