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

View File

@ -54,6 +54,7 @@ namespace Pinetime {
void FrameRateLow(); void FrameRateLow();
void DisplayOn(); void DisplayOn();
void DisplayOff(); void DisplayOff();
void PowerControl();
void SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); void SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
void SetVdv(); void SetVdv();
@ -81,6 +82,8 @@ namespace Pinetime {
FrameRate = 0xb3, FrameRate = 0xb3,
VdvSet = 0xc4, VdvSet = 0xc4,
Command2Enable = 0xdf, Command2Enable = 0xdf,
PowerControl1 = 0xd0,
PowerControl2 = 0xe8,
}; };
void WriteData(uint8_t data); void WriteData(uint8_t data);
void WriteData(const uint8_t* data, size_t size); void WriteData(const uint8_t* data, size_t size);