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_timer_handler` but a long blocking process 53 * can prevent the call of `lv_timer_handler`. In this case if 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 * Redrawn on object an all its children using the passed draw context 61 * @param draw pointer to an initialized draw context 62 * @param obj the start object from the redraw should start 63 */ 64 void lv_obj_redraw(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj); 65 66 /** 67 * Invalidate an area on display to redraw it 68 * @param area_p pointer to area which should be invalidated (NULL: delete the invalidated areas) 69 * @param disp pointer to display where the area should be invalidated (NULL can be used if there is 70 * only one display) 71 */ 72 void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p); 73 74 /** 75 * Get the display which is being refreshed 76 * @return the display being refreshed 77 */ 78 lv_disp_t * _lv_refr_get_disp_refreshing(void); 79 80 /** 81 * Set the display which is being refreshed. 82 * It shouldn't be used directly by the user. 83 * It can be used to trick the drawing functions about there is an active display. 84 * @param the display being refreshed 85 */ 86 void _lv_refr_set_disp_refreshing(lv_disp_t * disp); 87 88 #if LV_USE_PERF_MONITOR 89 /** 90 * Reset FPS counter 91 */ 92 void lv_refr_reset_fps_counter(void); 93 94 /** 95 * Get the average FPS 96 * @return the average FPS 97 */ 98 uint32_t lv_refr_get_fps_avg(void); 99 #endif 100 101 /** 102 * Called periodically to handle the refreshing 103 * @param timer pointer to the timer itself 104 */ 105 void _lv_disp_refr_timer(lv_timer_t * timer); 106 107 /********************** 108 * STATIC FUNCTIONS 109 **********************/ 110 111 #ifdef __cplusplus 112 } /*extern "C"*/ 113 #endif 114 115 #endif /*LV_REFR_H*/ 116