1 /*
2  * Copyright (c) 2018-2020 Jan Van Winkel <jan.van_winkel@dxplore.eu>
3  * Copyright (c) 2020 Teslabs Engineering S.L.
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #ifndef ZEPHYR_LIB_GUI_LVGL_LV_CONF_H_
9 #define ZEPHYR_LIB_GUI_LVGL_LV_CONF_H_
10 
11 /* Memory manager settings */
12 
13 #define LV_MEMCPY_MEMSET_STD 1
14 
15 #if defined(CONFIG_LV_Z_MEM_POOL_HEAP_LIB_C)
16 
17 #define LV_MEM_CUSTOM_INCLUDE	"stdlib.h"
18 #define LV_MEM_CUSTOM_ALLOC	malloc
19 #define LV_MEM_CUSTOM_REALLOC	realloc
20 #define LV_MEM_CUSTOM_FREE	free
21 
22 #else
23 
24 #define LV_MEM_CUSTOM_INCLUDE	"../zephyr/lvgl_mem.h"
25 #define LV_MEM_CUSTOM_ALLOC	lvgl_malloc
26 #define LV_MEM_CUSTOM_REALLOC	lvgl_realloc
27 #define LV_MEM_CUSTOM_FREE	lvgl_free
28 
29 #endif
30 
31 /* HAL settings */
32 
33 #define LV_TICK_CUSTOM			1
34 #define LV_TICK_CUSTOM_INCLUDE		<zephyr/kernel.h>
35 #define LV_TICK_CUSTOM_SYS_TIME_EXPR	(k_uptime_get_32())
36 
37 /* Misc settings */
38 
39 #define LV_SPRINTF_CUSTOM 1
40 #define LV_SPRINTF_INCLUDE "stdio.h"
41 #define lv_snprintf snprintf
42 #define lv_vsnprintf vsnprintf
43 
44 #endif /* ZEPHYR_LIB_GUI_LVGL_LV_CONF_H_ */
45