1 /**
2  * @file lv_refr.h
3  *
4  */
5 
6 #ifndef LV_REFR_H
7 #define LV_REFR_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 #include "lv_obj.h"
17 #include <stdbool.h>
18 
19 /*********************
20  *      DEFINES
21  *********************/
22 
23 #define LV_REFR_TASK_PRIO LV_TASK_PRIO_MID
24 
25 /**********************
26  *      TYPEDEFS
27  **********************/
28 
29 /**********************
30  *  STATIC PROTOTYPES
31  **********************/
32 
33 /**********************
34  *  STATIC VARIABLES
35  **********************/
36 
37 /**********************
38  *      MACROS
39  **********************/
40 
41 /**********************
42  *   GLOBAL FUNCTIONS
43  **********************/
44 
45 /**
46  * Initialize the screen refresh subsystem
47  */
48 void _lv_refr_init(void);
49 
50 /**
51  * Redraw the invalidated areas now.
52  * Normally the redrawing is periodically executed in `lv_task_handler` but a long blocking process
53  * can prevent the call of `lv_task_handler`. In this case if the the GUI is updated in the process
54  * (e.g. progress bar) this function can be called when the screen should be updated.
55  * @param disp pointer to display to refresh. NULL to refresh all displays.
56  */
57 void lv_refr_now(lv_disp_t * disp);
58 
59 /**
60  * Invalidate an area on display to redraw it
61  * @param area_p pointer to area which should be invalidated (NULL: delete the invalidated areas)
62  * @param disp pointer to display where the area should be invalidated (NULL can be used if there is
63  * only one display)
64  */
65 void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p);
66 
67 /**
68  * Get the display which is being refreshed
69  * @return the display being refreshed
70  */
71 lv_disp_t * _lv_refr_get_disp_refreshing(void);
72 
73 /**
74  * Set the display which is being refreshed.
75  * It shouldn't be used directly by the user.
76  * It can be used to trick the drawing functions about there is an active display.
77  * @param the display being refreshed
78  */
79 void _lv_refr_set_disp_refreshing(lv_disp_t * disp);
80 
81 /**
82  * Called periodically to handle the refreshing
83  * @param task pointer to the task itself
84  */
85 void _lv_disp_refr_task(lv_task_t * task);
86 
87 /**********************
88  *   STATIC FUNCTIONS
89  **********************/
90 
91 #ifdef __cplusplus
92 } /* extern "C" */
93 #endif
94 
95 #endif /*LV_REFR_H*/
96