Skip to content

Add support for SSD1680 e-paper controller #210

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_FT81X)
list(APPEND SOURCES "lvgl_tft/FT81x.c")
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_IL3820)
list(APPEND SOURCES "lvgl_tft/il3820.c")
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1680)
list(APPEND SOURCES "lvgl_tft/ssd1680.c")
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_JD79653A)
list(APPEND SOURCES "lvgl_tft/jd79653a.c")
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_UC8151D)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ swap of RGB565 color on the LVGL configuration menuconfig (it's not handled auto
| IL3820 | e-Paper | SPI | 1: 1byte per pixel | No |
| UC8151D/ GoodDisplay GDEW0154M10 DES | e-Paper | SPI | 1: 1byte per pixel | No |
| FitiPower JD79653A/ GoodDisplay GDEW0154M09 | e-Paper | SPI | 1: 1byte per pixel | No |
| SSD1680 / GoodDisplay GDEY029T94 | e-Paper | SPI | 1: 1byte per pixel | No |

## Supported indev controllers

Expand Down
1 change: 1 addition & 0 deletions component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ $(call compile_only_if,$(CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1306),lvgl_tft/ssd1
$(call compile_only_if,$(CONFIG_LV_TFT_DISPLAY_CONTROLLER_FT81X),lvgl_tft/EVE_commands.o)
$(call compile_only_if,$(CONFIG_LV_TFT_DISPLAY_CONTROLLER_FT81X),lvgl_tft/FT81x.o)
$(call compile_only_if,$(CONFIG_LV_TFT_DISPLAY_CONTROLLER_IL3820),lvgl_tft/il3820.o)
$(call compile_only_if,$(CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1306),lvgl_tft/ssd1680.o)
$(call compile_only_if,$(CONFIG_LV_TFT_DISPLAY_CONTROLLER_JD79653A),lvgl_tft/jd79653a.o)
$(call compile_only_if,$(CONFIG_LV_TFT_DISPLAY_CONTROLLER_UC8151D),lvgl_tft/uc8151d.o)
$(call compile_only_if,$(CONFIG_LV_TFT_DISPLAY_CONTROLLER_RA8875),lvgl_tft/ra8875.o)
Expand Down
2 changes: 2 additions & 0 deletions lvgl_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ extern "C" {
#define DISP_BUF_SIZE (LV_HOR_RES_MAX * DISP_BUF_LINES)
#elif defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_IL3820)
#define DISP_BUF_SIZE (LV_VER_RES_MAX * IL3820_COLUMNS)
#elif defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1680)
#define DISP_BUF_SIZE (LV_VER_RES_MAX * SSD1680_COLUMNS)
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_RA8875
#define DISP_BUF_SIZE (LV_HOR_RES_MAX * 40)
#elif defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_GC9A01)
Expand Down
1 change: 1 addition & 0 deletions lvgl_spi_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ extern "C" {
defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_SH1107) || \
defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_FT81X) || \
defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_IL3820) || \
defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1680) || \
defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_JD79653A) || \
defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9163C)

Expand Down
20 changes: 17 additions & 3 deletions lvgl_tft/Kconfig

Choose a reason for hiding this comment

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

Hi! Any chance you could share the setup necessary for LVGL? The display is filled with random dots (landscape or portrait) and the label is shown as a black strip while the text appears ghosted (and inverted) on another portion of the display. Thanks!

Copy link
Author

@AramVartanyan AramVartanyan Sep 17, 2023

Choose a reason for hiding this comment

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

Hi,
I had the same issue at first.

This is my default lvl config, which should make it work:

# LVGL configuration
#

CONFIG_LV_USE_USER_DATA=y

CONFIG_LV_COLOR_DEPTH_1=y
CONFIG_LV_THEME_MONO=y
CONFIG_LV_THEME_DEFAULT_INIT_MONO=y
CONFIG_LV_DISP_DEF_REFR_PERIOD=500

CONFIG_LV_TFT_DISPLAY_USER_CONTROLLER_SSD1680=y
CONFIG_LV_HOR_RES_MAX=128
CONFIG_LV_VER_RES_MAX=296
CONFIG_LV_DPI=112
CONFIG_LV_DISPLAY_ORIENTATION_LANDSCAPE=y

#
# Display Pin Assignments
#
CONFIG_LV_DISP_SPI_MOSI=38
# CONFIG_LV_DISPLAY_USE_SPI_MISO is not set
CONFIG_LV_DISP_SPI_CLK=37
CONFIG_LV_DISPLAY_USE_SPI_CS=y
CONFIG_LV_DISP_SPI_CS=36
CONFIG_LV_DISPLAY_USE_DC=y
CONFIG_LV_DISP_PIN_DC=35
CONFIG_LV_DISP_USE_RST=y
CONFIG_LV_DISP_PIN_RST=34
CONFIG_LV_DISP_PIN_BUSY=33

CONFIG_LV_DISP_BACKLIGHT_OFF=y

Unfortunately I do not have the display anymore.

Copy link

@glina126 glina126 Sep 18, 2023

Choose a reason for hiding this comment

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

Thanks for the quick reply! Fyi (and for anyone that stumbles on this), in the end, the LVGL buffer needed to be manually set up as it does not cover the entire screen and thus it was rendering only bits and pieces. Also, here is a fixed snipped for landscape mode (you have it backwards :)

    // mirrored index 
    uint16_t mirrored_idx = (EPD_PANEL_HEIGHT - x) + ((y >> 3) * EPD_PANEL_HEIGHT);
    byte_index = x + ((y >> 3) * EPD_PANEL_HEIGHT);
    bit_index  = y & 0x7;
    // 1 means white, 0 means black
    // note that the bit index is inverted in place
    if (color.full == 0) {
        BIT_SET(buf[mirrored_idx - 1], 7 - bit_index);
    } else {
        BIT_CLEAR(buf[mirrored_idx - 1], 7 - bit_index);
    }

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for fixing this.
That part was very blurry to me. Obviously I haven't understood it.

Is there a way for you to test it with the fix?
(Or you already have?!)

Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ menu "LVGL TFT Display controller"
bool
help
IL3820 epaper display controller.

config LV_TFT_DISPLAY_CONTROLLER_SSD1680
bool
help
SSD1680 e-paper display controller for GoodDisplay GDEY029T94.
The resolution must be set as per a portrait mode:
LV_HOR_RES_MAX -> 128 and LV_VER_RES_MAX -> 296
And the actual use mode currently is Landskape only.

config LV_TFT_DISPLAY_CONTROLLER_JD79653A
bool
Expand Down Expand Up @@ -326,6 +334,12 @@ menu "LVGL TFT Display controller"
select LV_TFT_DISPLAY_CONTROLLER_IL3820
select LV_TFT_DISPLAY_PROTOCOL_SPI
select LV_TFT_DISPLAY_MONOCHROME
config LV_TFT_DISPLAY_USER_CONTROLLER_SSD1680
bool "SSD1680"
select LV_TFT_DISPLAY_CONTROLLER_SSD1680
select LV_TFT_DISPLAY_PROTOCOL_SPI
select LV_TFT_DISPLAY_MONOCHROME
select LV_TFT_USE_CUSTOM_SPI_CLK_DIVIDER
config LV_TFT_DISPLAY_USER_CONTROLLER_JD79653A
bool "JD79653A"
select LV_TFT_DISPLAY_CONTROLLER_JD79653A
Expand Down Expand Up @@ -521,7 +535,7 @@ menu "LVGL TFT Display controller"
default LV_TFT_SPI_CLK_DIVIDER_5 if LV_TFT_DISPLAY_CONTROLLER_ILI9481
default LV_TFT_SPI_CLK_DIVIDER_3 if LV_TFT_DISPLAY_CONTROLLER_HX8357
default LV_TFT_SPI_CLK_DIVIDER_10 if LV_TFT_DISPLAY_CONTROLLER_SH1107
default LV_TFT_SPI_CLK_DIVIDER_16 if LV_TFT_DISPLAY_CONTROLLER_JD79653A || LV_TFT_DISPLAY_CONTROLLER_UC8151D
default LV_TFT_SPI_CLK_DIVIDER_16 if LV_TFT_DISPLAY_CONTROLLER_JD79653A || LV_TFT_DISPLAY_CONTROLLER_UC8151D || LV_TFT_DISPLAY_CONTROLLER_SSD1680
default LV_TFT_SPI_CLK_DIVIDER_2

config LV_TFT_SPI_CLK_DIVIDER_1
Expand Down Expand Up @@ -907,8 +921,8 @@ menu "LVGL TFT Display controller"
Configure the display Reset pin here.

config LV_DISP_PIN_BUSY
int "GPIO for Busy" if LV_TFT_DISPLAY_CONTROLLER_IL3820 || LV_TFT_DISPLAY_CONTROLLER_JD79653A || LV_TFT_DISPLAY_CONTROLLER_UC8151D
default 35 if LV_TFT_DISPLAY_CONTROLLER_IL3820 || LV_TFT_DISPLAY_CONTROLLER_JD79653A || LV_TFT_DISPLAY_CONTROLLER_UC8151D
int "GPIO for Busy" if LV_TFT_DISPLAY_CONTROLLER_IL3820 || LV_TFT_DISPLAY_CONTROLLER_JD79653A || LV_TFT_DISPLAY_CONTROLLER_UC8151D || LV_TFT_DISPLAY_CONTROLLER_SSD1680
default 35 if LV_TFT_DISPLAY_CONTROLLER_IL3820 || LV_TFT_DISPLAY_CONTROLLER_JD79653A || LV_TFT_DISPLAY_CONTROLLER_UC8151D || LV_TFT_DISPLAY_CONTROLLER_SSD1680
default 35 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2
default 21 if IDF_TARGET_ESP32C3

Expand Down
8 changes: 8 additions & 0 deletions lvgl_tft/disp_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ void *disp_driver_init(void)
FT81x_init();
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_IL3820
il3820_init();
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1680
ssd1680_init();
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_RA8875
ra8875_init();
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_GC9A01
Expand Down Expand Up @@ -99,6 +101,8 @@ void disp_driver_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t *
FT81x_flush(drv, area, color_map);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_IL3820
il3820_flush(drv, area, color_map);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1680
ssd1680_flush(drv, area, color_map);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_RA8875
ra8875_flush(drv, area, color_map);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_GC9A01
Expand All @@ -122,6 +126,8 @@ void disp_driver_rounder(lv_disp_drv_t * disp_drv, lv_area_t * area)
sh1107_rounder(disp_drv, area);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_IL3820
il3820_rounder(disp_drv, area);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1680
ssd1680_rounder(disp_drv, area);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_JD79653A
jd79653a_lv_rounder_cb(disp_drv, area);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_UC8151D
Expand All @@ -140,6 +146,8 @@ void disp_driver_set_px(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_
sh1107_set_px_cb(disp_drv, buf, buf_w, x, y, color, opa);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_IL3820
il3820_set_px_cb(disp_drv, buf, buf_w, x, y, color, opa);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1680
ssd1680_set_px_cb(disp_drv, buf, buf_w, x, y, color, opa);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_JD79653A
jd79653a_lv_set_fb_cb(disp_drv, buf, buf_w, x, y, color, opa);
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_UC8151D
Expand Down
2 changes: 2 additions & 0 deletions lvgl_tft/disp_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ extern "C" {
#include "FT81x.h"
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_IL3820
#include "il3820.h"
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1680
#include "ssd1680.h"
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_RA8875
#include "ra8875.h"
#elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_GC9A01
Expand Down
Loading