Improvements#
General events#
In v5.3 you could add actions to only a few object types (like a button). In v6.0 you can do it for any object type using Events.
Use lv_obj_set_event_cb(obj, event_handler) to set an event callback for an object. In event_handler you will get the caller object and the event like LV_EVENT_CLICKED/PRESSED/VALUE_CHANGED etc.
Learn more in the Events documentation.
Better fonts#
A new font converter is created which supports kerning and some other features. It is written in Node.js so it should be easy to use offline.
You can choose more fonts and ranges to include them in the final font file.
Multi-display support#
In v6.0 you can have multiple displays, each with its own drivers and objects.
To learn more about multi-display support visit the Display documentation.
MicroPython#
A lot of improvements happened to smoothly support MicroPython. Learn more about MicroPython with LittlevGL.
New forum#
Not really a LittlevGL feature but it happens along with v6.0. We have launched a new, more modern forum: https://forum.littlevgl.com
You can easily log in with your GitHub or Google account.
The old forum will be moved to http://forumold.littlevgl.com
Migrating from v5.3 to v6.0#
v6.0 is not fully compatible with v5.3 because some API and conceptual changes have happened.
The most important things#
- Update your
lv_conf.hfromlv_conf_template.h - Generate your fonts again with the new converter: https://littlevgl.com/ttf-font-to-c-array
- Read the new documentation: https://docs.littlevgl.com
Actions vs Events#
lv_obj_set_event_cb(obj, callback)is used instead oflv_btn_set_action(btn, LV_BTN_ACTION_..., callback). Event callbacks are used to handle all the former actions (i.e. long pressed, released are handled by a single function).- Objects now automatically detect if they've been deleted, no need for returning
LV_RES_OK/LV_RES_INVin yourlv_event_cb_t. For this reason,lv_event_cb_tfunctions returnvoid.
Driver level#
- Driver function signatures now take an initial first parameter, the driver objects itself. This allows your driver functions to work with more than one physical device without requiring two separate drivers to be written.
- (i.e.
indevcallbacks now take an initial first parameter oflv_indev_t *) disp_flushis nowflush_cb. Instead of directly taking x/y coordinates, it takes anlv_area_targument which has x1, y1, x2, y2 fields- The
mem_fill(calledgpu_fill_cbin v6.0) fills an area instead of a line - Dynamically changeable display config. Instead of hardcoded in
lv_conf.h. - Need to explicitly initialize your display buffer and add it to your display driver. It replaces the VDB in v5.3. so there is no
LV_VDB_SIZEin v6.0 but you should use these display buffers. LV_HOR_RESandLV_VER_RESare replaced withLV_HOR_RES_MAXandLV_VER_RES_MAX, which define the maximum horizontal and vertical resolution of your display, respectively.LV_HOR_RESandLV_VER_RESstill work but always reflects the resolution of the lastly created display. (No difference with only one display).
Renames#
- All the macros like
USE_LV_BTNnow are likeLV_USE_BTN. - Rename symbols:
SYMBOL_HOME→LV_SYMBOL_HOME - Rename
LV_GROUP_KEY_...toLV_KEY_... - Several minor function API changes. Nearly all features are still present so you should find every v5.3 function but maybe with a slightly different name or usage
Animations#
- Renames in
lv_anim_t. Theready_cbget'slv_anim_t *as argument. lv_anim_set_...(&a)functions are added to replace manual initialization oflv_anim_tlv_style_anim_tis removed. Uselv_anim_t a;andlv_style_anim_set_...(&a, ...)instead.
Objects and Styles#
lv_obj_get_free_ptrandlv_obj_get_free_numare replaced bylv_obj_get_user_data. The type of the user data can be changed inlv_conf.h- All padding and fits are left, right, top, bottom instead of hor and ver.
- lv_canvas: use
lv_draw_...functions
Fonts#
- Font system is updated and now supports kerning. You can generate your fonts again with the new converter.
- Use the new online font converter to generate new fonts
- Built-in fonts have changed
Others#
- User data is now available for some other structures as well, like driver objects.
- Callbacks of
lv_tasknow receive a pointer to the task itself instead of the user data. The user data can be accessed astask->user_data - The
img_decoderis improved to cache the opened images. So e.g. PNG images are not decoded all the time but left open. Learn more in the Image documentation
Credits#
- @embeddedt for tirelessly supporting users and professional help in the development
- @amirgon for creating and maintaining the MicroPython binding
- @puzrin for creating the new font converter
And for every contributor who helped with pull requests, ideas and suggestions, testing and feedback —
Thank you very much for all of you!
