aod: lower voltage going to the display

This commit is contained in:
John Crawford 2023-10-17 08:19:01 -06:00 committed by JF
parent bf69e0dcc5
commit 0bcd7e0009
2 changed files with 17 additions and 0 deletions

View file

@ -27,6 +27,7 @@ void St7789::Init() {
#endif
NormalModeOn();
SetVdv();
PowerControl();
DisplayOn();
}
@ -176,6 +177,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) {
WriteCommand(static_cast<uint8_t>(Commands::ColumnAddressSet));
uint8_t colArgs[] = {

View file

@ -54,6 +54,7 @@ namespace Pinetime {
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 @@ namespace Pinetime {
FrameRate = 0xb3,
VdvSet = 0xc4,
Command2Enable = 0xdf,
PowerControl1 = 0xd0,
PowerControl2 = 0xe8,
};
void WriteData(uint8_t data);
void WriteData(const uint8_t* data, size_t size);