refactor: disp->display, res->result/resolution, hor/ver->horizontal/vertical, txt->text, angle->rotation, zoom->scale

This commit is contained in:
Gabor Kiss-Vamosi
2023-09-18 22:57:30 +02:00
parent 57a83cb2ad
commit 0721884ee9
202 changed files with 1894 additions and 1814 deletions

View File

@@ -34,7 +34,7 @@
**********************/
static void disp_init(void);
static void disp_flush(lv_disp_t * disp, const lv_area_t * area, lv_color_t * px_map);
static void disp_flush(lv_display_t * disp, const lv_area_t * area, lv_color_t * px_map);
/**********************
* STATIC VARIABLES
@@ -58,27 +58,27 @@ void lv_port_disp_init(void)
/*------------------------------------
* Create a display and set a flush_cb
* -----------------------------------*/
lv_disp_t * disp = lv_disp_create(MY_DISP_HOR_RES, MY_DISP_VER_RES);
lv_disp_set_flush_cb(disp, disp_flush);
lv_display_t * disp = lv_display_create(MY_DISP_HOR_RES, MY_DISP_VER_RES);
lv_display_set_flush_cb(disp, disp_flush);
/* Example 1
* One buffer for partial rendering*/
static lv_color_t buf_1_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
lv_disp_set_draw_buffers(disp, buf_1_1, NULL, sizeof(buf_1_1), LV_DISP_RENDER_MODE_PARTIAL);
lv_display_set_draw_buffers(disp, buf_1_1, NULL, sizeof(buf_1_1), LV_DISPLAY_RENDER_MODE_PARTIAL);
/* Example 2
* Two buffers for partial rendering
* In flush_cb DMA or similar hardware should be used to update the display in the background.*/
static lv_color_t buf_2_1[MY_DISP_HOR_RES * 10];
static lv_color_t buf_2_2[MY_DISP_HOR_RES * 10];
lv_disp_set_draw_buffers(disp, buf_2_1, buf_2_2, sizeof(buf_2_1), LV_DISP_RENDER_MODE_PARTIAL);
lv_display_set_draw_buffers(disp, buf_2_1, buf_2_2, sizeof(buf_2_1), LV_DISPLAY_RENDER_MODE_PARTIAL);
/* Example 3
* Two buffers screen sized buffer for double buffering.
* Both LV_DISP_RENDER_MODE_DIRECT and LV_DISP_RENDER_MODE_FULL works, see their comments*/
* Both LV_DISPLAY_RENDER_MODE_DIRECT and LV_DISPLAY_RENDER_MODE_FULL works, see their comments*/
static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES];
static lv_color_t buf_3_2[MY_DISP_HOR_RES * MY_DISP_VER_RES];
lv_disp_set_draw_buffers(disp, buf_3_1, buf_3_2, sizeof(buf_3_1), LV_DISP_RENDER_MODE_DIRECT);
lv_display_set_draw_buffers(disp, buf_3_1, buf_3_2, sizeof(buf_3_1), LV_DISPLAY_RENDER_MODE_DIRECT);
}
@@ -111,8 +111,8 @@ void disp_disable_update(void)
/*Flush the content of the internal buffer the specific area on the display.
*`px_map` contains the rendered image as raw pixel map and it should be copied to `area` on the display.
*You can use DMA or any hardware acceleration to do this operation in the background but
*'lv_disp_flush_ready()' has to be called when it's finished.*/
static void disp_flush(lv_disp_t * disp_drv, const lv_area_t * area, lv_color_t * px_map)
*'lv_display_flush_ready()' has to be called when it's finished.*/
static void disp_flush(lv_display_t * disp_drv, const lv_area_t * area, lv_color_t * px_map)
{
if(disp_flush_enabled) {
/*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/
@@ -130,7 +130,7 @@ static void disp_flush(lv_disp_t * disp_drv, const lv_area_t * area, lv_color_t
/*IMPORTANT!!!
*Inform the graphics library that you are ready with the flushing*/
lv_disp_flush_ready(disp_drv);
lv_display_flush_ready(disp_drv);
}
#else /*Enable this file at the top*/