From 7504cc8e7007c9f709b5b6d3677118ef805f6780 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 1 Aug 2024 09:53:51 +0200 Subject: [PATCH 01/15] test Nema --- Core/Src/gpu2d.c | 12 +- Core/Src/lvgl_port_display.c | 2 +- Core/Src/main.c | 10 +- .../Src/stm32u5xx_hal_gpu2d.c | 2 + Middlewares/Third_Party/LVGL/lv_conf.h | 13 + Middlewares/Third_Party/LVGL/lvgl | 2 +- STM32CubeIDE/.cproject | 12 +- STM32CubeIDE/.settings/language.settings.xml | 4 +- .../.settings/stm32cubeide.project.prefs | 4 +- .../NemaGFX/doc/NemaGFX_API_Manual.pdf | Bin 0 -> 1504187 bytes .../doc/NemaGFX_DebugApplicationNote.pdf | Bin 0 -> 120740 bytes .../Middlewares/NemaGFX/doc/NemaVG.pdf | Bin 0 -> 1500168 bytes .../doc/NemaVG1000_User_Manual_Public.pdf | Bin 0 -> 391980 bytes .../NemaGFX/doc/NemaVG_TSVG_Elements.pdf | Bin 0 -> 189886 bytes .../NemaGFX/doc/Pixpresso_Starting_Guide.pdf | Bin 0 -> 487623 bytes .../NemaGFX/include/build_version.h | 1 + .../NemaGFX/include/nema_blender.h | 178 +++ .../NemaGFX/include/nema_cmdlist.h | 208 ++++ .../Middlewares/NemaGFX/include/nema_core.h | 41 + .../Middlewares/NemaGFX/include/nema_easing.h | 369 ++++++ .../Middlewares/NemaGFX/include/nema_error.h | 69 ++ .../Middlewares/NemaGFX/include/nema_font.h | 184 +++ .../NemaGFX/include/nema_graphics.h | 1017 +++++++++++++++++ .../Middlewares/NemaGFX/include/nema_hal.h | 218 ++++ .../NemaGFX/include/nema_interpolators.h | 122 ++ .../Middlewares/NemaGFX/include/nema_math.h | 278 +++++ .../NemaGFX/include/nema_matrix3x3.h | 230 ++++ .../NemaGFX/include/nema_matrix4x4.h | 232 ++++ .../NemaGFX/include/nema_provisional.h | 124 ++ .../Middlewares/NemaGFX/include/nema_raster.h | 107 ++ .../NemaGFX/include/nema_sys_defs.h | 58 + .../NemaGFX/include/nema_transitions.h | 210 ++++ .../Middlewares/NemaGFX/include/nema_utils.h | 50 + .../Middlewares/NemaGFX/include/nema_vg.h | 218 ++++ .../NemaGFX/include/nema_vg_context.h | 187 +++ .../NemaGFX/include/nema_vg_font.h | 184 +++ .../NemaGFX/include/nema_vg_paint.h | 241 ++++ .../NemaGFX/include/nema_vg_path.h | 143 +++ .../NemaGFX/include/nema_vg_tsvg.h | 56 + .../NemaGFX/include/nema_vg_version.h | 55 + .../Middlewares/NemaGFX/include/tsi_malloc.h | 64 ++ .../Middlewares/NemaGFX/lib/core/README.txt | 6 + .../templates/nema_hal_baremetal_template.c | 218 ++++ .../templates/nema_hal_cmsis_os_template.c | 276 +++++ .../templates/nema_hal_freertos_template.c | 327 ++++++ .../templates/nema_hal_threadx_template.c | 309 +++++ .../NemaGFX/templates/platform_pool_config.h | 64 ++ .../Middlewares/NemaGFX/templates/readme.txt | 53 + 48 files changed, 6139 insertions(+), 19 deletions(-) create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/doc/NemaGFX_API_Manual.pdf create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/doc/NemaGFX_DebugApplicationNote.pdf create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/doc/NemaVG.pdf create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/doc/NemaVG1000_User_Manual_Public.pdf create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/doc/NemaVG_TSVG_Elements.pdf create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/doc/Pixpresso_Starting_Guide.pdf create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/build_version.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_blender.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_cmdlist.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_core.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_easing.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_error.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_font.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_graphics.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_hal.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_interpolators.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_math.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_matrix3x3.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_matrix4x4.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_provisional.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_raster.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_sys_defs.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_transitions.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_utils.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_vg.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_vg_context.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_vg_font.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_vg_paint.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_vg_path.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_vg_tsvg.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/nema_vg_version.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/include/tsi_malloc.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/lib/core/README.txt create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/templates/nema_hal_baremetal_template.c create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/templates/nema_hal_cmsis_os_template.c create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/templates/nema_hal_freertos_template.c create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/templates/nema_hal_threadx_template.c create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/templates/platform_pool_config.h create mode 100644 STM32CubeIDE/Middlewares/NemaGFX/templates/readme.txt diff --git a/Core/Src/gpu2d.c b/Core/Src/gpu2d.c index 6ff30c4..aa583e1 100644 --- a/Core/Src/gpu2d.c +++ b/Core/Src/gpu2d.c @@ -24,7 +24,7 @@ /* USER CODE END 0 */ -GPU2D_HandleTypeDef hgpu2d; +extern GPU2D_HandleTypeDef hgpu2d; /* GPU2D init function */ void MX_GPU2D_Init(void) @@ -37,11 +37,11 @@ void MX_GPU2D_Init(void) /* USER CODE BEGIN GPU2D_Init 1 */ /* USER CODE END GPU2D_Init 1 */ - hgpu2d.Instance = GPU2D; - if (HAL_GPU2D_Init(&hgpu2d) != HAL_OK) - { - Error_Handler(); - } +// hgpu2d.Instance = GPU2D; +// if (HAL_GPU2D_Init(&hgpu2d) != HAL_OK) +// { +// Error_Handler(); +// } /* USER CODE BEGIN GPU2D_Init 2 */ /* USER CODE END GPU2D_Init 2 */ diff --git a/Core/Src/lvgl_port_display.c b/Core/Src/lvgl_port_display.c index 4fbb282..b1b5fca 100644 --- a/Core/Src/lvgl_port_display.c +++ b/Core/Src/lvgl_port_display.c @@ -29,7 +29,7 @@ void lvgl_display_init (void) /* display initialization */ disp = lv_display_create(MY_DISP_HOR_RES, MY_DISP_VER_RES); - lv_display_set_buffers(disp, buf_1, NULL, sizeof(buf_1), LV_DISPLAY_RENDER_MODE_PARTIAL); + lv_display_set_buffers(disp, buf_1, NULL, sizeof(buf_1), LV_DISPLAY_RENDER_MODE_FULL); lv_display_set_flush_cb(disp, disp_flush); /* interrupt callback for DMA2D transfer */ diff --git a/Core/Src/main.c b/Core/Src/main.c index 9de2cab..379a9fe 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -127,15 +127,15 @@ int main(void) MX_ADC1_Init(); MX_ADF1_Init(); MX_CRC_Init(); - MX_DCACHE1_Init(); - MX_DCACHE2_Init(); +// MX_DCACHE1_Init(); +// MX_DCACHE2_Init(); MX_DMA2D_Init(); MX_FDCAN1_Init(); MX_GPU2D_Init(); MX_HASH_Init(); MX_I2C1_Init(); MX_I2C2_Init(); - MX_ICACHE_Init(); +// MX_ICACHE_Init(); MX_LTDC_Init(); MX_OCTOSPI1_Init(); MX_RNG_Init(); @@ -174,9 +174,9 @@ int main(void) lvgl_touchscreen_init(); /* lvgl demo */ - lv_demo_widgets(); +// lv_demo_widgets(); //lv_demo_music(); - //lv_demo_benchmark(); + lv_demo_benchmark(); /* USER CODE END 2 */ diff --git a/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_gpu2d.c b/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_gpu2d.c index 632d341..6ed1381 100644 --- a/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_gpu2d.c +++ b/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_gpu2d.c @@ -624,6 +624,8 @@ void HAL_GPU2D_IRQHandler(GPU2D_HandleTypeDef *hgpu2d) last_cl_id = GPU2D_ReadReg(hgpu2d->Instance, GPU2D_CLID); + + /* Command List Complete Callback */ #if (USE_HAL_GPU2D_REGISTER_CALLBACKS == 1) if (hgpu2d->CommandListCpltCallback != NULL) diff --git a/Middlewares/Third_Party/LVGL/lv_conf.h b/Middlewares/Third_Party/LVGL/lv_conf.h index 07b2d3a..36c2d79 100644 --- a/Middlewares/Third_Party/LVGL/lv_conf.h +++ b/Middlewares/Third_Party/LVGL/lv_conf.h @@ -181,6 +181,19 @@ #endif +#define LV_USE_NEMA_GFX 1 + +#if LV_USE_NEMA_GFX + /*Enable Vector Graphics Operations. Available only if NemaVG library is present*/ + #define LV_USE_NEMA_VG 1 + + #if LV_USE_NEMA_VG + /*Define application's resolution used for VG related buffer allocation */ + #define LV_NEMA_GFX_RESX 800 + #define LV_NEMA_GFX_RESY 600 + #endif +#endif + /*======================= * FEATURE CONFIGURATION *=======================*/ diff --git a/Middlewares/Third_Party/LVGL/lvgl b/Middlewares/Third_Party/LVGL/lvgl index 62796a6..3ca1158 160000 --- a/Middlewares/Third_Party/LVGL/lvgl +++ b/Middlewares/Third_Party/LVGL/lvgl @@ -1 +1 @@ -Subproject commit 62796a64bac11da00bb1ab6370670c434aad460f +Subproject commit 3ca1158ce7c47545c0a717207bec3a56c5be2c30 diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject index 52d7f08..497dc92 100644 --- a/STM32CubeIDE/.cproject +++ b/STM32CubeIDE/.cproject @@ -44,6 +44,8 @@