-
Notifications
You must be signed in to change notification settings - Fork 439
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
Added SSD1306 and SH1107 display controller, added ILI9341, SH1107 and SSD1306 sleep mode #94
Conversation
an-erd
commented
Apr 13, 2020
•
edited
Loading
edited
- Added display controller SSD1306
- Added display controller SH1107
- Added predefined device (Wemos Lolin ESP32 OLED 128x64 with SSD1306)
- Added predefined device (M5Stick with SH1107)
- Merged code for display orientation (commits 900c1d1 and 42c2fd2)
- Added SSD1306, ILI9341, SH1107 sleep mode
- Added SSD1306 and SH1107 inverse display, and display rotation (portrait/landscape)
- Kconfig cleanup
- Updated README.md
Display orientation
Added "helper" defines CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_*
* Cleanup for monochrome display * Added inverted display and landscape/portrait for ssd1306 and sh1107
* Cleanup for monochrome display * Added inverted display and landscape/portrait for ssd1306 and sh1107 * File cleanup, remove test pragma, indentation * Removed debug logs, removed predefined pins in Kconfig, add default to pins in Kconfig but then adkconfig entries even if not used, Readme updated
Thanks a lot for the contibution @an-erd, I tested your fork over the weekend with the SSD1306 controller and it works great. Just to be sure The Maybe we can do something like this in the disp_driver layer void disp_driver_set_px(struct _disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa)
{
#if defined CONFIG_LVGL_TFT_DISPLAY_CONTROLLER_SSD1306
ssd1306_set_px_cb(disp_drv, buf, buf_w, x, y, color, opa);
#elif defined CONFIG_LVGL_TFT_DISPLAY_CONTROLLER_SH1107
sh1107_set_px_cb(disp_drv, buf, buf_w, x, y, color, opa);
#endif
} So we end up with something like this: static lv_color_t buf1[DISP_BUF_SIZE];
static lv_color_t buf2[DISP_BUF_SIZE];
static lv_disp_buf_t disp_buf;
lv_disp_buf_init(&disp_buf, buf1, buf2, DISP_BUF_SIZE);
lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
disp_drv.flush_cb = disp_driver_flush;
disp_drv.buffer = &disp_buf;
#ifdef CONFIG_LVGL_TFT_DISPLAY_MONOCHROME
disp_drv.rounder_cb = disp_driver_rounder;
disp_drv.set_px_cb = disp_driver_set_px;
#endif
lv_disp_drv_register(&disp_drv); I was thinking on how to remove all the lvgl setup from the app_main function and do it on the What do you think? |
Yes, that's a good idea. I will implement it that way. I use the set_px_cb because one pixel is just one bit on the monochrome displays and so it's only used for these monochrome displays. And with this the buffer can be send to the display controller directly and thus efficiently. The rounder is necessary because both display driver use columns and pages (which is a height of 8 px und thus one byte), and thus we need to send complete pages to the display controller. |
Thanks for the explanation, I'm a bit behind the internal working of lvgl, need to do some toy projects to get a lot more familiar with it :) Regards |