Hi there
I was just wondering, if anyone ever though or did some work of porting https://github.com/littlevgl/lvgl to Micropython? There is a port of Micropython to LittleVGL (which is the other way https://blog.littlevgl.com/2019-02-20/m ... n-bindings or https://github.com/littlevgl/lvgl/issues/557) but a quick research did not revealed any answer on porting lvgl to MP.
Motivation is:
- Self contain GUI Framework including windows, buttons ...
- MIT Licences (Compatble with mpy)
- Quite actively developed
- Realize uPygame (To be realized, TBR) which would allow to write J&R games on micropython which would be great fun ..
The implementation would need:
- Realize a vport (Virual port) module to implement 8/16 bit high performance access to low level parallel port. This module (8 or 16 bit wide) would allow to write a 8 or 16 bit value to the module, dispatchiing the bits to the low level hardware (pins) for the given port (stm32, ...). Update the display should be done in C.
- Add little vgl github repo to lib
- Write lvgl upy module or a generator (supporting the as well the callbacks) to extmod
- Add configuration option to include lvgl in the build
- Call regular lvgl update from upy (if configuration option is valid)
- Realize configuration modules for different hardware.
- ....?
In the constructor the accessor to the low level HW (SPI, parallel (v)port 8/16 bit 6800/8080) would be injected. Further for each supported HW we would need a lv_conf.h file - or we may "motivate" little LVGL project to be more dynamic and allow eg. LCD size definition at run time.
So, coming back to my opening sentence: Does anybody know about work done in the mentioned direction?
Greetings
Tobias
LittlevGL support
LittlevGL support
badi
- MostlyHarmless
- Posts: 166
- Joined: Thu Nov 21, 2019 6:25 pm
- Location: Pennsylvania, USA
Re: LittlevGL support
Hi,
there is https://github.com/littlevgl/lv_micropython.git.
I was able to compile it but lacking the hardware, I could not test it. I only have monochrome SSD1306 displays floating around and the code is currently set up to include drivers for (what seems to be) 8-bit color touch-displays. They fail to compile when one tries to set the display depth to 1-bit. Also our SSD1306 driver is framebuf based, so to support that would require to teach LVGL to actually perform Python callbacks to refresh the display (it currently uses C callbacks that have the knowledge how to set pixels). For me personally LVGL is overkill for an SSD1306, so I did not devote more time to it.
However, it does compile and the fork is kept up to date WRT micropython/master.
Regards, Jan
there is https://github.com/littlevgl/lv_micropython.git.
I was able to compile it but lacking the hardware, I could not test it. I only have monochrome SSD1306 displays floating around and the code is currently set up to include drivers for (what seems to be) 8-bit color touch-displays. They fail to compile when one tries to set the display depth to 1-bit. Also our SSD1306 driver is framebuf based, so to support that would require to teach LVGL to actually perform Python callbacks to refresh the display (it currently uses C callbacks that have the knowledge how to set pixels). For me personally LVGL is overkill for an SSD1306, so I did not devote more time to it.
However, it does compile and the fork is kept up to date WRT micropython/master.
Regards, Jan
- MostlyHarmless
- Posts: 166
- Joined: Thu Nov 21, 2019 6:25 pm
- Location: Pennsylvania, USA
Re: LittlevGL support
For the record, the LVGL bindings repo was pointed out by @mattyt in another post.
Re: LittlevGL support
Your options are:badi wrote: ↑Sat Jan 04, 2020 7:51 pm
I was just wondering, if anyone ever though or did some work of porting https://github.com/littlevgl/lvgl to Micropython? There is a port of Micropython to LittleVGL (which is the other way https://blog.littlevgl.com/2019-02-20/m ... n-bindings or https://github.com/littlevgl/lvgl/issues/557) but a quick research did not revealed any answer on porting lvgl to MP.
- Use lv_micropython fork: https://github.com/littlevgl/lv_micropython
- Port lvgl to your micropython fork, as explained here: https://github.com/littlevgl/lv_binding ... -a-project
In general, the best place to ask questions related to LittlevGL + micropython is https://forum.littlevgl.com/c/micropython