Skip to content

Conversation

dr-glenn
Copy link

@dr-glenn dr-glenn commented Jul 23, 2025

Change description

Added code to esp_lcd_ssd1681 for Waveshare 2.7 inch (176x264) epaper display with SSD1680 controller.
The previous code only supported 1.54 inch (200x200) display. The revisions should be readily adaptable for other non-square displays.


Note

Adds SSD1680/1681 e‑paper support for 2.7" 176x264 panels with configurable dimensions, improved mirroring/bitmap handling, and new examples (incl. LVGL rotation).

  • Driver (SSD1681):
    • Add display_x/display_y to esp_lcd_ssd1681_config_t and driver state; allocate framebuffer and compute sizes using panel dims (not fixed 200x200).
    • Make SSD1681_PARAM_OUTPUT_CTRL(rows) parametric; set output control with actual row count.
    • Refine draw path for non-square panels: adjust cursor/area, data entry modes, and mirror (X/Y/XY) handling; update process_bitmap() to use dynamic dims and correct byte reversal.
    • Add optional debug logs and safe buffer free; expose helper set_panel_size().
  • Commands:
    • Update esp_lcd_ssd1681_commands.h with parametric output control and clarified data entry mode comments.
  • Examples (epaper_demo):
    • Support selecting 1.54" 200x200 or 2.7" 176x264; new 176x264 bitmaps; cropping helper; expanded mirror tests; pin presets for Waveshare ESP32-S3.
    • README updated for SSD1680/1681 and model selection.
  • LVGL:
    • Update existing LVGL demo to use dynamic resolutions/buffer sizes.
    • Add new epaper_lvgl_rotate example showcasing rotation via canvas/bitmap transform on e‑paper.

Written by Cursor Bugbot for commit b4edc7c. This will update automatically on new commits. Configure here.

@CLAassistant
Copy link

CLAassistant commented Jul 23, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot changed the title lcd: add Epaper 2.7 inch display lcd: add Epaper 2.7 inch display (BSP-702) Jul 23, 2025
@espzav
Copy link
Collaborator

espzav commented Jul 24, 2025

Hi, there is one PR (#521) which is solving rows. We haven't got HW for finish the PR. We will check it and merge it. It seems that your PR solving similar issue.

@dr-glenn
Copy link
Author

dr-glenn commented Jul 24, 2025 via email

@espzav
Copy link
Collaborator

espzav commented Jul 31, 2025

@dr-glenn Thank you for clarification. I will check it, compare and make review.
Please add pre-commit hook (https://docs.espressif.com/projects/esp-idf/en/latest/esp32/contribute/install-pre-commit-hook.html) for pass the CI.

@dr-glenn
Copy link
Author

dr-glenn commented Aug 1, 2025 via email

@espzav
Copy link
Collaborator

espzav commented Aug 4, 2025

I have added the pre-commit hook. Do I have to do another commit and push now?

You can use this command pre-commit run --files YOUR_FILENAME or pre-commit run --all-files (and commit+push only files regarding to this PR)
And please squash commits to one. Thank you
I am going to make review this week.


// Select the Waveshare or GooDisplay epaper display that you have.
// The display must use a SSD1680 or 1681 controller (see Waveshare documentation to be sure).
#define WAVE_27 1 // 2.7 inch V2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thisis not right place for selection the screen.
There will be nice to put width/height as runtime settings, when init.
For example add into this structure: esp_lcd_ssd1681_config_t

Same for this

#define SSD1681_LUT_SIZE                   159
#if defined(WAVE_154) && WAVE_154==1
#define SSD1681_EPD_1IN54_V2_WIDTH         200
#define SSD1681_EPD_1IN54_V2_HEIGHT        200
#define DISPLAY_W 200
#define DISPLAY_V 200
#define SQUARE_PANEL    1
#elif defined(WAVE_27) && WAVE_27==1
// Waveshare 2.7 inch
#define WAVE_27_V2_WIDTH         176
#define WAVE_27_V2_HEIGHT        264
#define DISPLAY_W 176
#define DISPLAY_V 264
#endif

@espzav espzav mentioned this pull request Aug 4, 2025
2 tasks
@espzav
Copy link
Collaborator

espzav commented Aug 4, 2025

I tried it on HW (SSD1680 - https://www.adafruit.com/product/4947, epaper_lvgl_demo) and I cannot rotate it (lv_disp_set_rotation(disp, LV_DISP_ROT_90);). In default, there is error about non-copy mode, when I change .non_copy_mode to true, still not rotated.

@dr-glenn
Copy link
Author

dr-glenn commented Aug 6, 2025 via email

@espzav
Copy link
Collaborator

espzav commented Aug 6, 2025

Hi @dr-glenn, I am trying lv_disp_set_rotation on all displays. It is calling example_lvgl_port_update_callback and rotate screen.
OK, I will wait for your changes. Thank you

@dr-glenn
Copy link
Author

dr-glenn commented Aug 6, 2025 via email

@espzav
Copy link
Collaborator

espzav commented Aug 13, 2025

Hi @dr-glenn, it seems that I need more time for this PR. I don't undertsand lot of thinks and I need deep study related ePaper drivers.
For example, I don't understand sizes - I tried my ePaper 250x122. The LVGL example was working, but image was too big and bad rotated. I don't understand, why it was working, when there is set 250x250. When I changed to my resolution, it wasn't working.
I would like to make it more verstile, but I am not sure, if it is possible.

@dr-glenn
Copy link
Author

dr-glenn commented Aug 20, 2025 via email

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

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.

3 participants