From c1f3a31b513e90b29f31f23ba24e5856837ea6d4 Mon Sep 17 00:00:00 2001 From: JF Date: Fri, 17 Jan 2020 22:16:45 +0100 Subject: Disable SPI, I²C, touch controller and display controller in sleep mode. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Re-enable them on wake up. Remove delays that were not needed in st7889 driver. Hopefully, it'll improve the battery life! --- src/drivers/SpiMaster.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/drivers/SpiMaster.h') diff --git a/src/drivers/SpiMaster.h b/src/drivers/SpiMaster.h index 9f2208e0..4f39dc39 100644 --- a/src/drivers/SpiMaster.h +++ b/src/drivers/SpiMaster.h @@ -23,9 +23,15 @@ namespace Pinetime { bool Init(const SpiModule spi, const Parameters& params); bool Write(const uint8_t* data, size_t size); + void Sleep(); + void Wakeup(); + private: NRF_SPI_Type * spiBaseAddress; uint8_t pinCsn; + + SpiMaster::SpiModule configSpiModule; + SpiMaster::Parameters configParams; }; } } -- cgit v1.2.3-70-g09d2