From a154b8f45e641fe98af10ef82b2e0f5849e5fcc2 Mon Sep 17 00:00:00 2001 From: Cem Aksoylar Date: Sun, 9 Apr 2023 22:19:23 -0700 Subject: [PATCH] feat(IL0323): Add alternative partial refresh option Adds Kconfig to enable the alternative partial refresh setting from @aumuell: "Gates scan only inside of the partial window" instead of setting PTL_SCAN when configuring the window for partial refreshes seems to limit degrading of areas outside the refresh window quite a bit. But https://github.com/CursedHardware/epd-driver-ic/blob/master/IL0323.pdf, p. 26 states that this is not the "default". --- app/module/drivers/display/Kconfig.il0323 | 4 ++++ app/module/drivers/display/il0323.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/module/drivers/display/Kconfig.il0323 b/app/module/drivers/display/Kconfig.il0323 index 1f23d6c0d2d..2704023ce9e 100644 --- a/app/module/drivers/display/Kconfig.il0323 +++ b/app/module/drivers/display/Kconfig.il0323 @@ -13,3 +13,7 @@ config IL0323 config IL0323_INVERT bool "Invert display" default n + +config IL0323_ALTERNATIVE_REFRESH + bool "Use an alternative approach for partial refreshes" + default n diff --git a/app/module/drivers/display/il0323.c b/app/module/drivers/display/il0323.c index 42a56427210..4eef5cfd36b 100644 --- a/app/module/drivers/display/il0323.c +++ b/app/module/drivers/display/il0323.c @@ -124,7 +124,11 @@ static int il0323_write(const struct device *dev, const uint16_t x, const uint16 ptl[IL0323_PTL_HRED_IDX] = x_end_idx; ptl[IL0323_PTL_VRST_IDX] = y; ptl[IL0323_PTL_VRED_IDX] = y_end_idx; +#if IS_ENABLED(CONFIG_IL0323_ALTERNATIVE_REFRESH) + ptl[sizeof(ptl) - 1] = 0; // limits fading outside of refresh window +#else ptl[sizeof(ptl) - 1] = IL0323_PTL_PT_SCAN; +#endif LOG_HEXDUMP_DBG(ptl, sizeof(ptl), "ptl"); il0323_busy_wait(cfg);