aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/St7789.cpp
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2023-05-07 18:24:34 +0200
committerJF <JF002@users.noreply.github.com>2023-06-04 17:22:27 +0200
commit4c0f897953aa8d478f3c941e75d3b2eb5611531d (patch)
tree28c926cf8e0319ce5b5369382af6dbf935e17918 /src/drivers/St7789.cpp
parent2fa3aaa1617849dd29fe55c844d5250df0cba955 (diff)
Power optimization - Improve SPI sleep mode
Ensure that all pins are set to their default configuration during sleep mode. Disable the workaround for FTPAN58 (SPI freezes when transfering a single byte) at the end of the transfer. This disables the resources needed for the workaround. Those changes reduce the power usage by 430-490µA.
Diffstat (limited to 'src/drivers/St7789.cpp')
-rw-r--r--src/drivers/St7789.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp
index cfd5bd2c..ed98c06d 100644
--- a/src/drivers/St7789.cpp
+++ b/src/drivers/St7789.cpp
@@ -187,10 +187,13 @@ void St7789::HardwareReset() {
void St7789::Sleep() {
SleepIn();
nrf_gpio_cfg_default(pinDataCommand);
+ nrf_gpio_cfg_default(26);
+ spi.Sleep();
NRF_LOG_INFO("[LCD] Sleep");
}
void St7789::Wakeup() {
+ spi.Wakeup();
nrf_gpio_cfg_output(pinDataCommand);
SleepOut();
VerticalScrollStartAddress(verticalScrollingStartAddress);