luat_rtc.h 782 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef LUAT_RTC_H
  2. #define LUAT_RTC_H
  3. #include "luat_base.h"
  4. #include "time.h"
  5. /**
  6. * @defgroup luatos_RTC 时钟接口(RTC)
  7. * @{
  8. */
  9. /**
  10. * @brief 设置系统时间
  11. *
  12. * @param tblock
  13. * @return int =0成功,其他失败
  14. */
  15. int luat_rtc_set(struct tm *tblock);
  16. /**
  17. * @brief 获取系统时间
  18. *
  19. * @param tblock
  20. * @return int =0成功,其他失败
  21. */
  22. int luat_rtc_get(struct tm *tblock);
  23. /** @}*/
  24. int luat_rtc_timer_start(int id, struct tm *tblock);
  25. int luat_rtc_timer_stop(int id);
  26. void luat_rtc_set_tamp32(uint32_t tamp);
  27. /**
  28. * @brief 设置时区,或者同步底层时区到应用层
  29. *
  30. * @param timezone 时区值的指针,如果是空的,则同步底层时区到应用层
  31. * @return int 当前时区
  32. */
  33. int luat_rtc_timezone(int* timezone);
  34. #endif