-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlvgl_ui.h
More file actions
66 lines (57 loc) · 1.67 KB
/
lvgl_ui.h
File metadata and controls
66 lines (57 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef LVGL_UI_H
#define LVGL_UI_H
#include "lvgl.h"
#include "data_binding.h"
#include "obj_registry.h"
#include "deferred_loader.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Initializes the runtime services required by the generated UI.
* Call this once before creating the UI (e.g., before calling create_ui).
*/
void lvgl_ui_init(void);
/**
* @brief Deinitializes the runtime services, freeing any allocated memory.
*/
void lvgl_ui_deinit(void);
/**
* @brief Process all pending lvgl_ui deferred work.
*
* Call this once per main loop iteration, immediately after lv_task_handler().
* It drains the deferred-loader queue (tab/tile lazy population) without using
* lv_async_call, which is unsafe in FreeRTOS ISR / timer context.
*
* Typical usage:
* @code
* while (1) {
* lv_task_handler();
* lvgl_ui_task_handler();
* // sleep or yield
* }
* @endcode
*/
void lvgl_ui_task_handler(void);
/**
* @brief A placeholder declaration for the UI creation function.
* This function will be defined in the C file generated by the lvgl_ui_generator.
*
* @param parent The parent lv_obj_t* onto which the UI should be created.
*/
extern void create_ui(lv_obj_t* parent);
/**
* @brief Destroys the UI rooted at *root_ptr and reclaims all file-scope
* allocations made by create_ui (e.g. hoisted lv_style_t* objects).
*
* If root_ptr is NULL or *root_ptr is NULL the call is a no-op and LVGL is
* assumed to clean up via the parent chain. On return, *root_ptr is set to
* NULL.
*
* @param root_ptr Pointer to the root lv_obj_t* passed to create_ui.
*/
extern void destroy_ui(lv_obj_t** root_ptr);
#ifdef __cplusplus
}
#endif
#endif // LVGL_UI_H