Skip to content

Commit

Permalink
ST7789: Add RAMCTRL mentioned in #1040.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Jan 15, 2025
1 parent 770d493 commit a761f9c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/st7789/st7789.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace pimoroni {
TEON = 0x35,
MADCTL = 0x36,
COLMOD = 0x3A,
RAMCTRL = 0xB0,
GCTRL = 0xB7,
VCOMS = 0xBB,
LCMCTRL = 0xC0,
Expand Down Expand Up @@ -79,6 +80,12 @@ namespace pimoroni {
command(reg::PWCTRL1, 2, "\xa4\xa1");
command(reg::FRCTRL2, 1, "\x0f");

// As noted in https://github.com/pimoroni/pimoroni-pico/issues/1040
// this is required to avoid a weird light grey banding issue with low brightness green.
// The banding is not visible without tweaking gamma settings (GMCTRP1 & GMCTRN1) but
// it makes sense to fix it anyway.
command(reg::RAMCTRL, 2, "\x00\xc0");

if(width == 240 && height == 240) {
command(reg::GCTRL, 1, "\x14");
command(reg::VCOMS, 1, "\x37");
Expand Down

0 comments on commit a761f9c

Please sign in to comment.