From da9ab4a7b44b3daed233d876f50c245ee4ee4229 Mon Sep 17 00:00:00 2001 From: mark9064 <30447455+mark9064@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:22:46 +0100 Subject: [PATCH] aod: lower lcd voltage --- src/drivers/St7789.cpp | 7 +++++++ src/drivers/St7789.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index 48b65acb..cdfa6a34 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -28,6 +28,7 @@ void St7789::Init() { NormalModeOn(); SetVdv(); PowerControl(); + GateControl(); DisplayOn(); } @@ -190,6 +191,12 @@ void St7789::PowerControl() { WriteData(0xb3); } +void St7789::GateControl() { + WriteCommand(static_cast(Commands::GateControl)); + // Lowest possible VGL/VGH + WriteData(0x00); +} + void St7789::SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) { WriteCommand(static_cast(Commands::ColumnAddressSet)); uint8_t colArgs[] = { diff --git a/src/drivers/St7789.h b/src/drivers/St7789.h index 68e9f058..96d16b93 100644 --- a/src/drivers/St7789.h +++ b/src/drivers/St7789.h @@ -55,6 +55,7 @@ namespace Pinetime { void DisplayOn(); void DisplayOff(); void PowerControl(); + void GateControl(); void SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); void SetVdv(); @@ -84,6 +85,7 @@ namespace Pinetime { Command2Enable = 0xdf, PowerControl1 = 0xd0, PowerControl2 = 0xe8, + GateControl = 0xb7, }; void WriteData(uint8_t data); void WriteData(const uint8_t* data, size_t size);