1 /**
2  * @file lv_hal_tick.h
3  * Provide access to the system tick with 1 millisecond resolution
4  */
5 
6 #ifndef LV_HAL_TICK_H
7 #define LV_HAL_TICK_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 #ifdef LV_CONF_INCLUDE_SIMPLE
17 #include "lv_conf.h"
18 #else
19 #include "../../lv_conf.h"
20 #endif
21 #include <stdint.h>
22 #include <stdbool.h>
23 
24 /*********************
25  *      DEFINES
26  *********************/
27 #ifndef LV_ATTRIBUTE_TICK_INC
28 #define LV_ATTRIBUTE_TICK_INC
29 #endif
30 
31 /**********************
32  *      TYPEDEFS
33  **********************/
34 
35 /**********************
36  * GLOBAL PROTOTYPES
37  **********************/
38 
39 //! @cond Doxygen_Suppress
40 
41 /**
42  * You have to call this function periodically
43  * @param tick_period the call period of this function in milliseconds
44  */
45 LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period);
46 
47 //! @endcond
48 
49 /**
50  * Get the elapsed milliseconds since start up
51  * @return the elapsed milliseconds
52  */
53 uint32_t lv_tick_get(void);
54 
55 /**
56  * Get the elapsed milliseconds since a previous time stamp
57  * @param prev_tick a previous time stamp (return value of systick_get() )
58  * @return the elapsed milliseconds since 'prev_tick'
59  */
60 uint32_t lv_tick_elaps(uint32_t prev_tick);
61 
62 /**********************
63  *      MACROS
64  **********************/
65 
66 #ifdef __cplusplus
67 } /* extern "C" */
68 #endif
69 
70 #endif /*LV_HAL_TICK_H*/
71