Author: John Crawford <coffeeboi47@protonmail.com>
aod: lower voltage going to the display
src/drivers/St7789.cpp | 14 ++++++++++++++ src/drivers/St7789.h | 3 +++
diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index 035d61c9dde01f11a9f0757cf30ca60779614dc8..48b65acbd2a916bfb43e770daa148330cfcb2c1c 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -27,6 +27,7 @@ DisplayInversionOn(); #endif NormalModeOn(); SetVdv(); + PowerControl(); DisplayOn(); } @@ -174,6 +175,19 @@ } void St7789::DisplayOn() { WriteCommand(static_cast<uint8_t>(Commands::DisplayOn)); +} + +void St7789::PowerControl() { + WriteCommand(static_cast<uint8_t>(Commands::PowerControl1)); + constexpr uint8_t args[] = { + 0xa4, // Constant + 0x00, // Lowest possible voltages + }; + WriteData(args, sizeof(args)); + + WriteCommand(static_cast<uint8_t>(Commands::PowerControl2)); + // Lowest possible boost circuit clocks + WriteData(0xb3); } void St7789::SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) { diff --git a/src/drivers/St7789.h b/src/drivers/St7789.h index e249e0b00403979d9267a50cd20d9b3a23368446..68e9f0582753a4e7cc5f080c1e10da3f74400f53 100644 --- a/src/drivers/St7789.h +++ b/src/drivers/St7789.h @@ -54,6 +54,7 @@ void FrameRateNormal(); void FrameRateLow(); void DisplayOn(); void DisplayOff(); + void PowerControl(); void SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); void SetVdv(); @@ -81,6 +82,8 @@ PixelFormat = 0x3a, FrameRate = 0xb3, VdvSet = 0xc4, Command2Enable = 0xdf, + PowerControl1 = 0xd0, + PowerControl2 = 0xe8, }; void WriteData(uint8_t data); void WriteData(const uint8_t* data, size_t size);