Skip to content
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

fix(LVGL port): Fixed monochromatic screen in LVGL9 + example #392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

espzav
Copy link
Collaborator

@espzav espzav commented Sep 12, 2024

ESP-BSP Pull Request checklist

  • Version of modified component bumped
  • CI passing

Change description

  • Fixed using monochromatic screens with LVGL port and LVGL9
  • Support for LV_COLOR_FORMAT_I1 for monochromatic screen

@espzav espzav force-pushed the fix/lvgl_port_monochromatic_v9 branch from 8c56428 to 240d997 Compare September 13, 2024 08:57
Copy link
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@espzav Changes LGTM.

Although I don't really understand the monochrome color.
Is this something that was broken by LVGL? Should we migrate to their built-in monochrome color?

components/esp_lvgl_port/src/lvgl9/esp_lvgl_port_disp.c Outdated Show resolved Hide resolved
Copy link

@DrStone71 DrStone71 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi,

with dependencies:
lvgl/lvgl: "==9.2.2"
esp_lcd_sh1107: "==1.1.0"
esp_lvgl_port: "==2.4.2"

i haved make changes and with SSD1306 Display works fine.

Tanks

@obaranov
Copy link

I also verified the fix on the ssd1306 (128x64), and graphics now works fine with lvgl9.

dependencies:
  espressif/esp_lvgl_port: 
    git: https://github.com/espressif/esp-bsp.git
    path: components/esp_lvgl_port
    version: fix/lvgl_port_monochromatic_v9

@mutatrum
Copy link

Confirmed the fix is working. For the i2c_oled example, when moving to LVGL 9, the following line needs to be removed:

This might need to be added to the readme of that example.

@espzav espzav force-pushed the fix/lvgl_port_monochromatic_v9 branch from 240d997 to 8bb2402 Compare November 21, 2024 14:24
@espzav espzav marked this pull request as ready for review November 22, 2024 12:50
@espzav
Copy link
Collaborator Author

espzav commented Nov 22, 2024

Hi @tore-espressif, I added support for I1 color type for monochromatic screens and fixed some minor issues. PTAL

@mutatrum
Copy link

mutatrum commented Nov 22, 2024

Confirmed, example now works with LVGL 9.2.2 and SSD1306 132x32 display. LGTM. Thanks!

Works with LV_COLOR_DEPTH 1 and 16.


ESP_LOGI(TAG, "Install panel IO");
esp_lcd_panel_io_handle_t io_handle = NULL;
esp_lcd_panel_io_i2c_config_t io_config = {
.dev_addr = EXAMPLE_I2C_HW_ADDR,
.scl_speed_hz = EXAMPLE_LCD_PIXEL_CLOCK_HZ,
.control_phase_bytes = 1, // According to SSD1306 datasheet
.lcd_cmd_bits = EXAMPLE_LCD_CMD_BITS, // According to SSD1306 datasheet
.lcd_param_bits = EXAMPLE_LCD_CMD_BITS, // According to SSD1306 datasheet
Copy link

@mutatrum mutatrum Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 73 should be EXAMPLE_LCD_PARAM_BITS constant. (Not sure why it's referring a different line). No functional change, as they are the same value.

@mutatrum
Copy link

mutatrum commented Nov 22, 2024

I've also tested this on an SSH1107 132x64 screen. This works, however, as this screen is oriented differently, I wanted to rotate the screen. Here I noticed the screen rotation is broken in LVGL 9.

With LVGL 8.4, I can just set lv_disp_set_rotation(disp, LV_DISPLAY_ROTATION_90); (or another non-0 value) in the example code and the screen is rotated. With LVGL 9, the application crashes with a WDT when using 90 or 270. 180 is fine. I haven't dug into the code yet.

When I set color_format = LV_COLOR_FORMAT_I1 and a 90 or 270 rotation doesn't crash, but the result is garbled flickering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants