-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LVGL embedded GUI library #603
Conversation
ef0504a
to
cd84b7f
Compare
CI: Error generating documentation for device hosted-linux: 'NoneType' object is not subscriptable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll test in hardware and check why the docs generator is broken (yet again).
I enabled DMA2D for the STM32 devices that have it. I don't see any visual difference in performance, but maybe it helps elsewhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I have not enabled this on purpose and will disable it again because the user has to take care of configuring DMA2D/PXP manually and implementing DMA2D would have to become a configurable option in any case, since it could possibly be used by a display driver as well. |
7c31019
to
1f7845b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
ext/lvgl/lvgl.lb
Outdated
|
||
- https://lvgl.io/ | ||
- https://github.com/lvgl/lvgl | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, we should mention the lv_conf_local.h
mechanism, I'll add a fixup commit in a second.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, there's a file called lv_conf_internal.h
that contains a lot of defaults.
We should also implement LV_TICK_CUSTOM_SYS_TIME_EXPR
to use modm::Clock::now
to remove the need for a manual call to lv_tick_inc()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've implemented and tested LV_TICK_CUSTOM_SYS_TIME_EXPR
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only other thing I found interesting in terms of a modm port was LV_ATTRIBUTE_FAST_MEM
which we could set to __attribute__((sections(".fastcode")))
. However, 15-20kB of RAM seems like a lot and would probably cause issues if set by default. So I didn't.
/* Prefix performance critical functions to place them into a faster memory (e.g RAM)
* Uses 15-20 kB extra memory */
#define LV_ATTRIBUTE_FAST_MEM
Ok, I've played around with the
Is this config approach ok for you? |
(Sorry about the fixup! mess, I'll happily squash this all together if you want). |
Very nice, I like this approach. Thanks! I built this PR on my attempts from >1 year ago with LittlevGL v5/v6, back then |
ext/lvgl/lv_conf.h.in
Outdated
/*==================== | ||
Graphical settings | ||
*====================*/ | ||
|
||
/* Maximal horizontal and vertical resolution to support by the library.*/ | ||
#define LV_HOR_RES_MAX ({{ options.resolution_horizontal_max }}) | ||
#define LV_VER_RES_MAX ({{ options.resolution_vertical_max }}) | ||
|
||
/* Color depth: | ||
* - 1: 1 byte per pixel | ||
* - 8: RGB332 | ||
* - 16: RGB565 | ||
* - 32: ARGB8888 | ||
*/ | ||
#define LV_COLOR_DEPTH {{ options.color_depth }} | ||
|
||
/* Enable anti-aliasing (lines, and radiuses will be smoothed) */ | ||
#ifndef LV_ANTIALIAS | ||
#define LV_ANTIALIAS 0 | ||
#endif | ||
|
||
/* Dot Per Inch: used to initialize default sizes. | ||
* E.g. a button with width = LV_DPI / 2 -> half inch wide | ||
* (Not so important, you can adjust it to modify default sizes and spaces)*/ | ||
#define LV_DPI {{ options.dpi }} /*[px]*/ | ||
|
||
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */ | ||
typedef int16_t lv_coord_t; | ||
|
||
/*========================= | ||
Memory manager settings | ||
*=========================*/ | ||
|
||
/* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc` and `lv_mem_free` */ | ||
#define LV_MEM_CUSTOM 1 | ||
|
||
/*================== | ||
* Feature usage | ||
*==================*/ | ||
|
||
/* 1: Enable GPU interface*/ | ||
#ifndef LV_USE_GPU | ||
#define LV_USE_GPU 0 /*Only enables `gpu_fill_cb` and `gpu_blend_cb` in the disp. drv- */ | ||
#endif | ||
|
||
/* 1: Enable file system (might be required for images */ | ||
#ifndef LV_USE_FILESYSTEM | ||
#define LV_USE_FILESYSTEM 0 | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also remove all this lbuild options and instead let the user configure them through <lv_conf_local.h>
. What do you think?
Edit: Except for LV_MEM_CUSTOM
, and below LV_TICK_CUSTOM*
and LV_USE_LOG
/LV_LOG_LEVEL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would prefer that since the lbuild options don't add any additional benefits (ie. like other modules being able to query display size). I'll add a few more fixups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved all config options out of lbuild into lv_conf_local.h
incl. logging, since it's weird to have to regenerate modm again just for that one option. I like this solution very much, it's very clean and minimal.
Co-authored-by: Raphael Lehmann <[email protected]>
Merge? |
Got my ili9341 on monday. |
and/or SSD1306 displays