![]() |
RA Flexible Software Package Documentation
Release v6.0.0
|
|
Functions | |
fsp_err_t | RM_LVGL_PORT_Open (rm_lvgl_port_instance_ctrl_t *const p_instance_ctrl, rm_lvgl_port_cfg_t const *const p_cfg) |
LVGL graphics library port for RA MCUs.
The LVGL RA Port module provides the configuration necessary for use of the LVGL graphics library on RA products. The port provides integration for GLCDC into the LVGL display system, a time source for LVGL timer logic, and optional integration with FreeRTOS.
Hardware acceleration is optionally provided by DRW using a lightly modified fork of the upstream driver provided by the LVGL project. Most rendering operations are supported.
Configuration | Options | Default | Description |
---|---|---|---|
General | |||
Custom lv_conf.h | Manual Entry | Add a path to your custom lv_conf.h file. It can be used to override some or all of the configurations defined here, and to define additional configurations. | |
LVGL | |||
LVGL > Display | |||
LV_COLOR_DEPTH | Value must equal 16 or 32. | 16 | Color depth. 16 or 32 supported. |
LVGL > Memory | |||
LV_MEM_SIZE | Value must be an integer multiple of 1024 between 0x800 and 0xFFFFFFFF. | 0x10000 | Size of the memory available for `lv_malloc()` in bytes. |
LV_DRAW_LAYER_SIMPLE_BUF_SIZE | Value must be an integer multiple of 1024 between 0x400 and 0xFFFFFFFF. | 0x6000 | Buffer size for simple layer chunks. |
LV_DRAW_LAYER_MAX_MEMORY | Value must be an integer. | 0 | Limit the max allocated memory for simple and transformed layers. 0 for no limit. Otherwise, should be greater than or equal to LV_DRAW_LAYER_SIMPLE_BUF_SIZE. If transformed layers are used, it should be large enough for the largest widget (width x height x 4 area). |
LV_DRAW_THREAD_STACK_SIZE | Value must be an integer multiple of 1024 between 0x400 and 0xFFFFFFFF. | 0x2000 | Stack size of the drawing thread in bytes. Only used when FreeRTOS integration is used. |
LVGL > OS Integration | |||
LV_USE_OS |
| LV_OS_FREERTOS | Select LVGL RTOS integration. |
LV_DRAW_THREAD_PRIO |
| LV_THREAD_PRIO_HIGH | Thread priority of the drawing task. |
LVGL > Software Rendering | |||
LV_DRAW_SW_SUPPORT_RGB565 |
| Enabled | Enable software rendering support for the specified color format. Disable to reduce code size. Some formats may be used internally for some features. |
LV_DRAW_SW_SUPPORT_RGB565_SWAPPED |
| Enabled | Enable software rendering support for the specified color format. Disable to reduce code size. Some formats may be used internally for some features. |
LV_DRAW_SW_SUPPORT_RGB565A8 |
| Enabled | Enable software rendering support for the specified color format. Disable to reduce code size. Some formats may be used internally for some features. |
LV_DRAW_SW_SUPPORT_RGB888 |
| Enabled | Enable software rendering support for the specified color format. Disable to reduce code size. Some formats may be used internally for some features. |
LV_DRAW_SW_SUPPORT_XRGB8888 |
| Enabled | Enable software rendering support for the specified color format. Disable to reduce code size. Some formats may be used internally for some features. |
LV_DRAW_SW_SUPPORT_ARGB8888 |
| Enabled | Enable software rendering support for the specified color format. Disable to reduce code size. Some formats may be used internally for some features. |
LV_DRAW_SW_SUPPORT_ARGB8888_PREMULTIPLIED |
| Enabled | Enable software rendering support for the specified color format. Disable to reduce code size. Some formats may be used internally for some features. |
LV_DRAW_SW_SUPPORT_L8 |
| Enabled | Enable software rendering support for the specified color format. Disable to reduce code size. Some formats may be used internally for some features. |
LV_DRAW_SW_SUPPORT_AL88 |
| Enabled | Enable software rendering support for the specified color format. Disable to reduce code size. Some formats may be used internally for some features. |
LV_DRAW_SW_SUPPORT_A8 |
| Enabled | Enable software rendering support for the specified color format. Disable to reduce code size. Some formats may be used internally for some features. |
LV_DRAW_SW_SUPPORT_I1 |
| Enabled | Enable software rendering support for the specified color format. Disable to reduce code size. Some formats may be used internally for some features. |
LVGL > Hardware Rendering | |||
LV_USE_DRAW_DAVE2D |
| Enabled | Enable built-in DRW Engine support. |
LVGL > Debug | |||
LV_ASSERT_HANDLER_INCLUDE | Manual Entry | <stdint.h> | Header file to include to support LV_ASSERT_HANDLER macro. |
LV_ASSERT_HANDLER | Manual Entry | Macro to execute when an LV_ASSERT occurs. | |
LVGL > Widgets | |||
LV_USE_OBJ_NAME |
| Disabled | Enable support for widget names. |
LVGL > Input Devices | |||
LV_USE_GESTURE_RECOGNITION |
| Disabled | Enable support for multi-touch gesture recognition. Requires floating point support. |
LV_USE_IME_PINYIN |
| Disabled | Enable Pinyin input method. |
LV_IME_PINYIN_USE_DEFAULT_DICT |
| Enabled | Use default thesaurus. |
LV_IME_PINYIN_CAND_TEXT_NUM | Value must be positive. | 6 | Maximum number of displayed candidate panels. Adjust according to screen size. |
LV_IME_PINYIN_USE_K9_MODE |
| Enabled | Use nine key (K9) input. |
LV_IME_PINYIN_K9_CAND_TEXT_NUM | Value must be positive. | 3 | Maximum number of displayed candidate panels in K9 mode. Adjust according to screen size. |
LVGL > Fonts | |||
LVGL > Fonts > Montserrat | |||
LV_FONT_MONTSERRAT_8 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 8. |
LV_FONT_MONTSERRAT_10 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 10. |
LV_FONT_MONTSERRAT_12 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 12. |
LV_FONT_MONTSERRAT_14 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 14. |
LV_FONT_MONTSERRAT_16 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 16. |
LV_FONT_MONTSERRAT_18 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 18. |
LV_FONT_MONTSERRAT_20 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 20. |
LV_FONT_MONTSERRAT_22 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 22. |
LV_FONT_MONTSERRAT_24 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 24. |
LV_FONT_MONTSERRAT_26 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 26. |
LV_FONT_MONTSERRAT_28 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 28. |
LV_FONT_MONTSERRAT_30 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 30. |
LV_FONT_MONTSERRAT_32 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 32. |
LV_FONT_MONTSERRAT_34 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 34. |
LV_FONT_MONTSERRAT_36 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 36. |
LV_FONT_MONTSERRAT_38 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 38. |
LV_FONT_MONTSERRAT_40 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 40. |
LV_FONT_MONTSERRAT_42 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 42. |
LV_FONT_MONTSERRAT_44 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 44. |
LV_FONT_MONTSERRAT_46 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 46. |
LV_FONT_MONTSERRAT_48 |
| Enabled | Enable built-in font (FontAwesome5, Montserrat) size 48. |
LVGL > Fonts > DejaVu | |||
LV_FONT_DEJAVU_16_PERSIAN_HEBREW |
| Enabled | Enable built-in font DejaVu (Arabic, Hebrew, Persian) size 16. |
LVGL > Fonts > SourceHanSansSC | |||
LV_FONT_SOURCE_HAN_SANS_SC_14_CJK |
| Enabled | Enable built-in font SourceHanSansSC size 14. |
LV_FONT_SOURCE_HAN_SANS_SC_16_CJK |
| Enabled | Enable built-in font SourceHanSansSC size 16. |
LVGL > Fonts > Unscii | |||
LV_FONT_UNSCII_8 |
| Enabled | Enable built-in font unscii-8 size 8. |
LV_FONT_UNSCII_16 |
| Enabled | Enable built-in font unscii-8 size 16. |
LV_FONT_DEFAULT | Name must be a valid C symbol. | lv_font_montserrat_14 | Set a default font for LVGL. Required. |
LV_USE_FONT_PLACEHOLDER |
| Enabled | Draw a placeholder when a glyph is not found. |
LV_USE_BIDI |
| Disabled | Enable bidirectional text. |
LV_USE_ARABIC_PERSIAN_CHARS |
| Disabled | Enable Arabic and Persian language processing. |
LV_USE_FONT_MANAGER |
| Disabled | Enable the font manager. |
LV_FONT_MANAGER_NAME_MAX_LEN | Value must be positive. | 32 | Maximum font name length when font manager is enabled. |
Configuration | Options | Default | Description |
---|---|---|---|
Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
Provide Tick Callback |
| Enabled | Enable the LVGL port driver to provide a tick callback to LVGL. |
Configuration | Options | Default | Description |
---|---|---|---|
Name | Name must be a valid C symbol | g_rm_lvgl_port0 | Module name. |
Target Display Layer |
| Graphics Layer 1 | Specify which graphics screen to inherit the buffer and display dimensions from. |
Callback Function | Must be a valid C symbol | NULL | If a callback function is provided it will be called when Display events occur. |
No clocks or pins are directly required by this module. Please consult the GLCDC Usage Guide for its requirements here: Graphics LCD (r_glcdc)
LVGL is configured via the use of a configuration header. The port layer provides configuration options within e2 Studio for commonly changed LVGL settings and autogenerates the required header files. It is also possible to provide a custom LVGL configuration header which overrides the LVGL configuration options set in e2 Studio, or configures options that are not exposed in the port layer in e2 Studio.
To get started with LVGL in an RA project the following must be performed:
At this point the project is now ready to build with LVGL. Please refer to the LVGL Project Documentation for details on how to use LVGL in your project, as well as LVGL demo and example code.
The LVGL packed with FSP also includes the demos
and examples
directories that are in the LVGL project. To allow the demos to be included and built in a user project:
lv_conf_custom.h
LV_BUILD_DEMOS
macro to 1
in the custom header, to override the value set in the generated lv_conf.h
LV_USE_DEMO_*
macro to 1
in the the custom header, to enable the desired demolv_timer_handler()
to set up the demoIncluding and building the examples in a user project are the same steps, but set the LV_BUILD_EXAMPLES
macro to 1
in the custom header instead. No LV_USE_
macros should be required for the examples.
The LVGL packed with FSP also includes the libs
directory that is in the LVGL project. Only bin_decoder
is packed as a mandatory library. The source for the remaining libraries is omitted.
LVGL is not a thread safe library. Please refer to Tasks and threads for information on how to use LVGL in a multi-thread environment.
Developers should be aware of the following limitations when using LVGL with FSP:
This is a basic example demonstrating the initialization of LVGL and the port layer within a FreeRTOS thread entry function, then servicing LVGL timer logic in a loop.
Data Structures | |
struct | rm_lvgl_port_callback_args_t |
struct | rm_lvgl_port_cfg_t |
struct | rm_lvgl_port_instance_ctrl_t |
Enumerations | |
enum | rm_lvgl_port_device_t |
enum | rm_lvgl_port_event_t |
struct rm_lvgl_port_callback_args_t |
Callback arguments for the FSP LVGL Port
Data Fields | ||
---|---|---|
rm_lvgl_port_device_t | device | Device code. |
rm_lvgl_port_event_t | event | Event code of the low level hardware. |
uint32_t | error | Error code if RM_LVGL_PORT_EVENT_ERROR. |
struct rm_lvgl_port_cfg_t |
Configuration structure for the FSP LVGL Port
struct rm_lvgl_port_instance_ctrl_t |
Instance control block for LVGL Port
enum rm_lvgl_port_event_t |
fsp_err_t RM_LVGL_PORT_Open | ( | rm_lvgl_port_instance_ctrl_t *const | p_instance_ctrl, |
rm_lvgl_port_cfg_t const *const | p_cfg | ||
) |
Open the LVGL port driver module.
Example:
FSP_SUCCESS | LVGL port successfully opened. |
FSP_ERR_OUT_OF_MEMORY | Internal call to lv_display_create() failed to allocate memory for a display. |
See Common_Error_Codes for other possible return codes. This function calls R_GLCDC_Open(), R_GLCDC_Start(), and R_GLCDC_BufferChange().