1 /*
2  * Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
3  * Copyright 2023 NXP
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #ifndef ZEPHYR_MODULES_LVGL_DISPLAY_H_
9 #define ZEPHYR_MODULES_LVGL_DISPLAY_H_
10 
11 #include <zephyr/drivers/display.h>
12 #include <lvgl.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 struct lvgl_disp_data {
19 	const struct device *display_dev;
20 	struct display_capabilities cap;
21 	bool blanking_on;
22 };
23 
24 struct lvgl_display_flush {
25 	lv_display_t *display;
26 	uint16_t x;
27 	uint16_t y;
28 	struct display_buffer_descriptor desc;
29 	void *buf;
30 };
31 
32 void lvgl_flush_cb_mono(lv_display_t *display, const lv_area_t *area, uint8_t *px_map);
33 void lvgl_flush_cb_16bit(lv_display_t *display, const lv_area_t *area, uint8_t *px_map);
34 void lvgl_flush_cb_24bit(lv_display_t *display, const lv_area_t *area, uint8_t *px_map);
35 void lvgl_flush_cb_32bit(lv_display_t *display, const lv_area_t *area, uint8_t *px_map);
36 
37 void lvgl_rounder_cb_mono(lv_event_t *e);
38 void lvgl_set_mono_conversion_buffer(uint8_t *buffer, uint32_t buffer_size);
39 
40 int set_lvgl_rendering_cb(lv_display_t *display);
41 
42 void lvgl_flush_display(struct lvgl_display_flush *request);
43 
44 #ifdef CONFIG_LV_Z_USE_ROUNDER_CB
45 void lvgl_rounder_cb(lv_event_t *e);
46 #endif
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif /* ZEPHYR_MODULES_LVGL_DISPLAY_H_ */
53