summaryrefslogtreecommitdiff
path: root/src/libs/lvgl/porting
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/lvgl/porting')
-rw-r--r--src/libs/lvgl/porting/lv_port_disp_template.c19
-rw-r--r--src/libs/lvgl/porting/lv_port_fs_template.c38
-rw-r--r--src/libs/lvgl/porting/lv_port_indev_template.c2
3 files changed, 30 insertions, 29 deletions
diff --git a/src/libs/lvgl/porting/lv_port_disp_template.c b/src/libs/lvgl/porting/lv_port_disp_template.c
index 295dbe1c..9752d5d9 100644
--- a/src/libs/lvgl/porting/lv_port_disp_template.c
+++ b/src/libs/lvgl/porting/lv_port_disp_template.c
@@ -9,7 +9,7 @@
/*********************
* INCLUDES
*********************/
-#include "lv_port_disp_templ.h"
+#include "lv_port_disp_template.h"
/*********************
* DEFINES
@@ -26,8 +26,9 @@ static void disp_init(void);
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p);
#if LV_USE_GPU
-static void gpu_blend(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
-static void gpu_fill(lv_color_t * dest, uint32_t length, lv_color_t color);
+static void gpu_blend(lv_disp_drv_t * disp_drv, lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
+static void gpu_fill(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width,
+ const lv_area_t * fill_area, lv_color_t color);
#endif
/**********************
@@ -112,10 +113,10 @@ void lv_port_disp_init(void)
/*Optionally add functions to access the GPU. (Only in buffered mode, LV_VDB_SIZE != 0)*/
/*Blend two color array using opacity*/
- disp_drv.gpu_blend = gpu_blend;
+ disp_drv.gpu_blend_cb = gpu_blend;
/*Fill a memory array with a color*/
- disp_drv.gpu_fill = gpu_fill;
+ disp_drv.gpu_fill_cb = gpu_fill;
#endif
/*Finally register the driver*/
@@ -151,7 +152,7 @@ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_colo
/* IMPORTANT!!!
* Inform the graphics library that you are ready with the flushing*/
- lv_disp_flush_ready(disp);
+ lv_disp_flush_ready(disp_drv);
}
@@ -171,11 +172,11 @@ static void gpu_blend(lv_disp_drv_t * disp_drv, lv_color_t * dest, const lv_colo
/* If your MCU has hardware accelerator (GPU) then you can use it to fill a memory with a color
* It can be used only in buffered mode (LV_VDB_SIZE != 0 in lv_conf.h)*/
-static void gpu_fill_cb(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width,
- const lv_area_t * fill_area, lv_color_t color);
+static void gpu_fill(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width,
+ const lv_area_t * fill_area, lv_color_t color)
{
/*It's an example code which should be done by your GPU*/
- uint32_t x, y;
+ int32_t x, y;
dest_buf += dest_width * fill_area->y1; /*Go to the first line*/
for(y = fill_area->y1; y < fill_area->y2; y++) {
diff --git a/src/libs/lvgl/porting/lv_port_fs_template.c b/src/libs/lvgl/porting/lv_port_fs_template.c
index dab94608..454899d6 100644
--- a/src/libs/lvgl/porting/lv_port_fs_template.c
+++ b/src/libs/lvgl/porting/lv_port_fs_template.c
@@ -9,7 +9,7 @@
/*********************
* INCLUDES
*********************/
-#include "lv_port_fs_templ.h"
+#include "lv_port_fs_template.h"
/*********************
* DEFINES
@@ -85,30 +85,30 @@ void lv_port_fs_init(void)
*--------------------------------------------------*/
/* Add a simple drive to open images */
- lv_fs_drv_t fs_drv; /*A driver descriptor*/
- memset(&fs_drv, 0, sizeof(lv_fs_drv_t)); /*Initialization*/
+ lv_fs_drv_t fs_drv;
+ lv_fs_drv_init(&fs_drv);
/*Set up fields...*/
fs_drv.file_size = sizeof(file_t);
fs_drv.letter = 'P';
- fs_drv.open = fs_open;
- fs_drv.close = fs_close;
- fs_drv.read = fs_read;
- fs_drv.write = fs_write;
- fs_drv.seek = fs_seek;
- fs_drv.tell = fs_tell;
- fs_drv.free = fs_free;
- fs_drv.size = fs_size;
- fs_drv.remove = fs_remove;
- fs_drv.rename = fs_rename;
- fs_drv.trunc = fs_trunc;
+ fs_drv.open_cb = fs_open;
+ fs_drv.close_cb = fs_close;
+ fs_drv.read_cb = fs_read;
+ fs_drv.write_cb = fs_write;
+ fs_drv.seek_cb = fs_seek;
+ fs_drv.tell_cb = fs_tell;
+ fs_drv.free_space_cb = fs_free;
+ fs_drv.size_cb = fs_size;
+ fs_drv.remove_cb = fs_remove;
+ fs_drv.rename_cb = fs_rename;
+ fs_drv.trunc_cb = fs_trunc;
fs_drv.rddir_size = sizeof(dir_t);
- fs_drv.dir_close = fs_dir_close;
- fs_drv.dir_open = fs_dir_open;
- fs_drv.dir_read = fs_dir_read;
+ fs_drv.dir_close_cb = fs_dir_close;
+ fs_drv.dir_open_cb = fs_dir_open;
+ fs_drv.dir_read_cb = fs_dir_read;
- lv_fs_add_drv(&fs_drv);
+ lv_fs_drv_register(&fs_drv);
}
/**********************
@@ -315,7 +315,7 @@ static lv_fs_res_t fs_rename (lv_fs_drv_t * drv, const char * oldname, const cha
* @param free_p pointer to store the free size [kB]
* @return LV_FS_RES_OK or any error from lv_fs_res_t enum
*/
-static lv_fs_res_t fs_free (uint32_t * total_p, uint32_t * free_p)
+static lv_fs_res_t fs_free (lv_fs_drv_t * drv, uint32_t * total_p, uint32_t * free_p)
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
diff --git a/src/libs/lvgl/porting/lv_port_indev_template.c b/src/libs/lvgl/porting/lv_port_indev_template.c
index 7666023b..54b8c9fd 100644
--- a/src/libs/lvgl/porting/lv_port_indev_template.c
+++ b/src/libs/lvgl/porting/lv_port_indev_template.c
@@ -9,7 +9,7 @@
/*********************
* INCLUDES
*********************/
-#include "lv_port_indev_templ.h"
+#include "lv_port_indev_template.h"
/*********************
* DEFINES