1 /**
2  * @file lv_vglite_buf.h
3  *
4  */
5 
6 /**
7  * Copyright 2023 NXP
8  *
9  * SPDX-License-Identifier: MIT
10  */
11 
12 #ifndef LV_VGLITE_BUF_H
13 #define LV_VGLITE_BUF_H
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /*********************
20  *      INCLUDES
21  *********************/
22 #include "../../../lv_conf_internal.h"
23 
24 #if LV_USE_DRAW_VGLITE
25 #include "../../lv_draw.h"
26 
27 #include "vg_lite.h"
28 
29 /*********************
30  *      DEFINES
31  *********************/
32 
33 /**********************
34  *      TYPEDEFS
35  **********************/
36 
37 /**********************
38  * GLOBAL PROTOTYPES
39  **********************/
40 
41 /**
42  * Get vglite destination buffer pointer.
43  *
44  * @retval The vglite destination buffer
45  *
46  */
47 vg_lite_buffer_t * vglite_get_dest_buf(void);
48 
49 /**
50  * Get vglite source buffer pointer.
51  *
52  * @retval The vglite source buffer
53  *
54  */
55 vg_lite_buffer_t * vglite_get_src_buf(void);
56 
57 /**
58  * Set vglite destination buffer address only.
59  *
60  * @param[in] buf Destination buffer address (does not require alignment for VG_LITE_LINEAR mode)
61  *
62  */
63 void vglite_set_dest_buf_ptr(void * buf);
64 
65 /**
66  * Set vglite source buffer address only.
67  *
68  * @param[in] buf Source buffer address
69  *
70  */
71 void vglite_set_src_buf_ptr(const void * buf);
72 
73 /**
74  * Set vglite destination buffer.
75  *
76  * @param[in] buf Destination buffer address
77  * @param[in] width Destination buffer width
78  * @param[in] height Destination buffer height
79  * @param[in] stride Destination buffer stride in bytes
80  * @param[in] cf Destination buffer color format
81  *
82  */
83 void vglite_set_dest_buf(const void * buf, uint32_t width, uint32_t height, uint32_t stride,
84                          lv_color_format_t cf);
85 
86 /**
87  * Set vglite source buffer.
88  *
89  * @param[in] buf Source buffer address
90  * @param[in] width Source buffer width
91  * @param[in] height Source buffer height
92  * @param[in] stride Source buffer stride in bytes
93  * @param[in] cf Source buffer color format
94  *
95  */
96 void vglite_set_src_buf(const void * buf, uint32_t width, uint32_t height, uint32_t stride,
97                         lv_color_format_t cf);
98 
99 /**
100  * Set vglite buffer.
101  *
102  * @param[in] vgbuf Address of the VGLite buffer object
103  * @param[in] buf Address of the memory for the VGLite buffer
104  * @param[in] width Buffer width
105  * @param[in] height Buffer height
106  * @param[in] stride Buffer stride in bytes
107  * @param[in] cf Buffer color format
108  *
109  */
110 void vglite_set_buf(vg_lite_buffer_t * vgbuf, void * buf,
111                     uint32_t width, uint32_t height, uint32_t stride,
112                     lv_color_format_t cf);
113 
114 /**********************
115  *      MACROS
116  **********************/
117 
118 #endif /*LV_USE_DRAW_VGLITE*/
119 
120 #ifdef __cplusplus
121 } /*extern "C"*/
122 #endif
123 
124 #endif /*LV_VGLITE_BUF_H*/
125