luat_timer.h 428 B

12345678910111213141516171819202122232425
  1. #ifndef LUAT_TIMER_H
  2. #define LUAT_TIMER_H
  3. #include "luat_base.h"
  4. #include "luat_msgbus.h"
  5. typedef struct luat_timer
  6. {
  7. void* os_timer;
  8. size_t id;
  9. size_t timeout;
  10. size_t type;
  11. int repeat;
  12. luat_msg_handler func;
  13. }luat_timer_t;
  14. int luat_timer_start(luat_timer_t* timer);
  15. int luat_timer_stop(luat_timer_t* timer);
  16. luat_timer_t* luat_timer_get(size_t timer_id);
  17. int luat_timer_mdelay(size_t ms);
  18. #endif