1 /** 2 * @file lv_timer_private.h 3 * 4 */ 5 6 #ifndef LV_TIMER_PRIVATE_H 7 #define LV_TIMER_PRIVATE_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 17 #include "lv_timer.h" 18 19 /********************* 20 * DEFINES 21 *********************/ 22 23 /********************** 24 * TYPEDEFS 25 **********************/ 26 27 /** 28 * Descriptor of a lv_timer 29 */ 30 struct _lv_timer_t { 31 uint32_t period; /**< How often the timer should run */ 32 uint32_t last_run; /**< Last time the timer ran */ 33 lv_timer_cb_t timer_cb; /**< Timer function */ 34 void * user_data; /**< Custom user data */ 35 int32_t repeat_count; /**< 1: One time; -1 : infinity; n>0: residual times */ 36 uint32_t paused : 1; 37 uint32_t auto_delete : 1; 38 }; 39 40 typedef struct { 41 lv_ll_t timer_ll; /**< Linked list to store the lv_timers */ 42 43 bool lv_timer_run; 44 uint8_t idle_last; 45 bool timer_deleted; 46 bool timer_created; 47 uint32_t timer_time_until_next; 48 49 bool already_running; 50 uint32_t periodic_last_tick; 51 uint32_t busy_time; 52 uint32_t idle_period_start; 53 uint32_t run_cnt; 54 55 lv_timer_handler_resume_cb_t resume_cb; 56 void * resume_data; 57 } lv_timer_state_t; 58 59 /********************** 60 * GLOBAL PROTOTYPES 61 **********************/ 62 63 /** 64 * Init the lv_timer module 65 */ 66 void lv_timer_core_init(void); 67 68 /** 69 * Deinit the lv_timer module 70 */ 71 void lv_timer_core_deinit(void); 72 73 /********************** 74 * MACROS 75 **********************/ 76 77 #ifdef __cplusplus 78 } /*extern "C"*/ 79 #endif 80 81 #endif /*LV_TIMER_PRIVATE_H*/ 82