| 1 |
.. _neochrom: |
| 2 |
|
| 3 |
======== |
| 4 |
NeoChrom |
| 5 |
======== |
| 6 |
|
| 7 |
LVGL integrates NeoChrom as a :ref:`draw unit <draw units>`. |
| 8 |
|
| 9 |
|
| 10 |
Ready-to-use Projects that have NeoChrom enabled |
| 11 |
************************************************ |
| 12 |
|
| 13 |
`lv_port_riverdi_stm32u5 <https://github.com/lvgl/lv_port_riverdi_stm32u5>`__ |
| 14 |
is a ready-to-use port for the Riverdi STM32 5.0" Embedded Display |
| 15 |
(STM32U599NJH6Q or STM32U5A9NJH6Q) which has NeoChrom enabled. |
| 16 |
Follow the instructions in the readme to get started. |
| 17 |
|
| 18 |
`lv_port_stm32u5g9j-dk2 <https://github.com/lvgl/lv_port_stm32u5g9j-dk2>`__ |
| 19 |
is a ready-to-use port for the STM32U5G9J-DK2 devkit with a 5.0" display |
| 20 |
and a NeoChrom VG GPU. |
| 21 |
Follow the instructions in the readme to get started. |
| 22 |
|
| 23 |
`lv_port_stm32h7s78-dk <https://github.com/lvgl/lv_port_stm32h7s78-dk>`__ |
| 24 |
is a ready-to-use port for the STM32H7S78-DK devkit with a 5.0" display |
| 25 |
and a NeoChrom GPU. It's a high performance MCU with an ARM Cortex-M7 core. |
| 26 |
Follow the instructions in the readme to get started. |
| 27 |
|
| 28 |
|
| 29 |
Usage and Configuration |
| 30 |
*********************** |
| 31 |
|
| 32 |
Enable the renderer by setting :c:macro:`LV_USE_NEMA_GFX` to ``1`` in |
| 33 |
lv_conf.h. |
| 34 |
|
| 35 |
Set :c:macro:`LV_USE_NEMA_LIB` to the correct version for the core in |
| 36 |
your MCU. If left as ``LV_NEMA_LIB_NONE``, M33 RevC will be assumed. |
| 37 |
|
| 38 |
If using :c:macro:`LV_USE_NEMA_VG`, |
| 39 |
set :c:macro:`LV_NEMA_GFX_MAX_RESX` and :c:macro:`LV_NEMA_GFX_MAX_RESY` |
| 40 |
to the size of the display you will be using so that enough static |
| 41 |
memory will be reserved for VG. Without VG, more task types will be |
| 42 |
performed by the software renderer. |
| 43 |
|
| 44 |
"libs/nema_gfx" contains pre-compiled binaries for the NeoChrom GPU drivers. |
| 45 |
|
| 46 |
`lv_port_riverdi_stm32u5 <https://github.com/lvgl/lv_port_riverdi_stm32u5>`__ |
| 47 |
is already configured to link the "cortex_m33_revC" binaries when building. |
| 48 |
`lv_port_stm32u5g9j-dk2 <https://github.com/lvgl/lv_port_stm32u5g9j-dk2>`__ |
| 49 |
is configured to link the "cortex_m33_NemaPVG" binaries when building. |
| 50 |
`lv_port_stm32h7s78-dk <https://github.com/lvgl/lv_port_stm32h7s78-dk>`__ |
| 51 |
is configured to link the "cortex_m7" binaries when building. |
| 52 |
|
| 53 |
"cortex_m33_revC" works on all STM32 Cortex-M33 devices with a NeoChrom core while "cortex_m33_NemaPVG" |
| 54 |
additionally supports the tessellation and matrix multiplication acceleration that |
| 55 |
the STM32 U5F and U5G NeoChrom cores are capable of. |
| 56 |
"cortex_m7" should be used on MCUs with a Cortex-M7 core |
| 57 |
and "cortex_m55" should be used on MCUs with a Cortex-M55 core. |
| 58 |
|
| 59 |
With a different STM32CubeIDE project, you can configure the libraries to be linked |
| 60 |
by right-clicking the project in the "Project Explorer" sidebar, clicking |
| 61 |
"Properties", navigating to "C/C++ Build", "Settings", "MCU G++ Linker", and then |
| 62 |
"Libraries". Add an entry under "Libraries (-l)" that is "nemagfx-float-abi-hard". |
| 63 |
Add an entry under "Library search path (-L)" which is a path to |
| 64 |
"libs/nema_gfx/lib/core/cortex_m33_revC/gcc" e.g. |
| 65 |
"${workspace_loc:/${ProjName}/Middlewares/LVGL/lvgl/libs/nema_gfx/lib/core/cortex_m33_revC/gcc}". |
| 66 |
Click "Apply and Close". |
| 67 |
|
| 68 |
.. note:: |
| 69 |
|
| 70 |
``cannot find -lnemagfx-float-abi-hard: No such file or directory`` |
| 71 |
|
| 72 |
The library version for ST was updated to ``revC`` so the path component |
| 73 |
``cortex_m33`` must be updated to ``cortex_m33_revC`` in STM32CubeIDE. |
| 74 |
|
| 75 |
|
| 76 |
32 and 16 bit :c:macro:`LV_COLOR_DEPTH` is supported. |
| 77 |
|
| 78 |
NeoChrom requires a simple HAL implementation to allocate memory and optionally |
| 79 |
lock resources. You may use a custom HAL implementation for your platform or use one of the |
| 80 |
provided implementations by setting :c:macro:`LV_USE_NEMA_HAL` to a value other than |
| 81 |
:c:macro:`LV_NEMA_HAL_CUSTOM`. |
| 82 |
|
| 83 |
If your core has a data cache and it's enabled, which may be the case when using a Cortex-M7, |
| 84 |
you may set :c:macro:`LV_NEMA_STM32_HAL_ATTRIBUTE_POOL_MEM` to a compiler-specific attribute |
| 85 |
that will place the memory shared between the CPU and the GPU in a region of memory that is |
| 86 |
not cached. This requires coordination from the linker script and memory protection unit |
| 87 |
configuration. See `lv_port_stm32h7s78-dk <https://github.com/lvgl/lv_port_stm32h7s78-dk>`__ |
| 88 |
as a reference. |
| 89 |
|
| 90 |
|
| 91 |
.. _neochrom vector graphics: |
| 92 |
|
| 93 |
Vector Graphics |
| 94 |
*************** |
| 95 |
|
| 96 |
The NeoChrom VG driver in LVGL can render vector graphics Widgets using NeoChrom VG's |
| 97 |
hardware support for vector graphics drawing. You can display SVG files in your application. |
| 98 |
See the SVG examples for usage. |
| 99 |
|
| 100 |
To use vector graphics with NeoChrom, you should enable the following configs in ``lv_conf.h``. |
| 101 |
|
| 102 |
.. code-block:: |
| 103 |
|
| 104 |
LV_USE_NEMA_GFX 1 |
| 105 |
LV_USE_NEMA_VG 1 |
| 106 |
LV_USE_VECTOR_GRAPHIC 1 |
| 107 |
LV_USE_MATRIX 1 |
| 108 |
LV_USE_FLOAT 1 |
| 109 |
|
| 110 |
To use the SVG widget, additionally enable :c:macro:`LV_USE_SVG`. |
| 111 |
|
| 112 |
If there is RAM available, SVG performance can be increased by enabling the image cache, :c:macro:`LV_CACHE_DEF_SIZE`. |
| 113 |
:c:macro:`LV_CACHE_DEF_SIZE` is a cache size in bytes. If it is large enough for your SVGs, |
| 114 |
it will cache decoded SVG data so it does not need to be parsed every refresh, significantly |
| 115 |
reducing SVG redraw time. |
| 116 |
|
| 117 |
:c:macro:`LV_USE_DEMO_VECTOR_GRAPHIC` is a demo you can enable which draws some vector graphics shapes. |
| 118 |
Gradient and image fills are not supported yet, as well as dashed strokes. These are |
| 119 |
missing from the demo when it is run with the NeoChrom driver. |
| 120 |
|
| 121 |
|
| 122 |
TSC Images |
| 123 |
********** |
| 124 |
|
| 125 |
`The TSC converter can be downloaded from here. <https://drive.google.com/file/d/1wUcurTe1bvwC6e-tMDbXd1-e5kS8YdQK/view?usp=sharing>`_ |
| 126 |
|
| 127 |
TSC (ThinkSilicon Compression) images can be drawn by this renderer. The |
| 128 |
TSC 4/6/6A/12/12A color formats are part of :cpp:type:`lv_color_format_t`. |
| 129 |
All other renderers will ignore images with these color formats. |
| 130 |
Define an image descriptor variable with the corresponding |
| 131 |
TSC color format and the GPU will be able to draw it directly. |
| 132 |
Stride does not need to be specified because it will be computed by the |
| 133 |
renderer. |
| 134 |
|
| 135 |
.. code-block:: c |
| 136 |
|
| 137 |
const lv_image_dsc_t img_demo_widgets_avatar_tsc6a = { |
| 138 |
.header.cf = LV_COLOR_FORMAT_NEMA_TSC6A, |
| 139 |
.header.w = 144, |
| 140 |
.header.h = 144, |
| 141 |
.data = img_demo_widgets_avatar_tsc6a_map, |
| 142 |
.data_size = sizeof(img_demo_widgets_avatar_tsc6a_map), |
| 143 |
}; |
| 144 |
|
| 145 |
|
| 146 |
Interop with the LTDC driver and the DMA2D Draw Unit |
| 147 |
**************************************************** |
| 148 |
|
| 149 |
NeoChrom can be enabled at the same time as LTDC. They will not interfere |
| 150 |
with each other at all. |
| 151 |
|
| 152 |
NeoChrom and DMA2D may be enabled at the same time. They are both draw units |
| 153 |
and they will both independently accept draw tasks. |
| 154 |
|
| 155 |
|
| 156 |
API |
| 157 |
*** |
| 158 |
|
| 159 |
.. API startswith: lv_draw_nema_ |
| 160 |
|
| 161 |
.. API startswith: lv_nemagfx_ |