summaryrefslogtreecommitdiff
path: root/src/drivers/St7789.cpp
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-06-06 18:27:54 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-06-06 23:09:58 (GMT)
commit7c45f185a32c7bcff47c8fda1acdec82d3213717 (patch)
tree53b0419fe2a19e6ec5c89d0be0a11dcd8d4ceb00 /src/drivers/St7789.cpp
parent94b1b330fc1f6e941a797fedabade4e790e28bc2 (diff)
parent35dcf8c8607483c104711c9398d47d57147f4389 (diff)
Merge remote-tracking branch 'origin/develop' into analog24
Diffstat (limited to 'src/drivers/St7789.cpp')
-rw-r--r--src/drivers/St7789.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp
index fd1366f..3ed1beb 100644
--- a/src/drivers/St7789.cpp
+++ b/src/drivers/St7789.cpp
@@ -23,6 +23,7 @@ void St7789::Init() {
RowAddressSet();
DisplayInversionOn();
NormalModeOn();
+ SetVdv();
DisplayOn();
}
@@ -114,6 +115,13 @@ void St7789::WriteToRam() {
WriteCommand(static_cast<uint8_t>(Commands::WriteToRam));
}
+void St7789::SetVdv() {
+ // By default there is a large step from pixel brightness zero to one.
+ // After experimenting with VCOMS, VRH and VDV, this was found to produce good results.
+ WriteCommand(static_cast<uint8_t>(Commands::VdvSet));
+ WriteData(0x10);
+}
+
void St7789::DisplayOff() {
WriteCommand(static_cast<uint8_t>(Commands::DisplayOff));
nrf_delay_ms(500);