Skip to content

Commit 0bcd7e0

Browse files
KaffeinatedKatJF002
authored andcommitted
aod: lower voltage going to the display
1 parent bf69e0d commit 0bcd7e0

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/drivers/St7789.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ void St7789::Init() {
2727
#endif
2828
NormalModeOn();
2929
SetVdv();
30+
PowerControl();
3031
DisplayOn();
3132
}
3233

@@ -176,6 +177,19 @@ void St7789::DisplayOn() {
176177
WriteCommand(static_cast<uint8_t>(Commands::DisplayOn));
177178
}
178179

180+
void St7789::PowerControl() {
181+
WriteCommand(static_cast<uint8_t>(Commands::PowerControl1));
182+
constexpr uint8_t args[] = {
183+
0xa4, // Constant
184+
0x00, // Lowest possible voltages
185+
};
186+
WriteData(args, sizeof(args));
187+
188+
WriteCommand(static_cast<uint8_t>(Commands::PowerControl2));
189+
// Lowest possible boost circuit clocks
190+
WriteData(0xb3);
191+
}
192+
179193
void St7789::SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) {
180194
WriteCommand(static_cast<uint8_t>(Commands::ColumnAddressSet));
181195
uint8_t colArgs[] = {

src/drivers/St7789.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ namespace Pinetime {
5454
void FrameRateLow();
5555
void DisplayOn();
5656
void DisplayOff();
57+
void PowerControl();
5758

5859
void SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
5960
void SetVdv();
@@ -81,6 +82,8 @@ namespace Pinetime {
8182
FrameRate = 0xb3,
8283
VdvSet = 0xc4,
8384
Command2Enable = 0xdf,
85+
PowerControl1 = 0xd0,
86+
PowerControl2 = 0xe8,
8487
};
8588
void WriteData(uint8_t data);
8689
void WriteData(const uint8_t* data, size_t size);

0 commit comments

Comments
 (0)