diff options
author | JF <jf@codingfield.com> | 2020-01-17 22:16:45 +0100 |
---|---|---|
committer | JF <jf@codingfield.com> | 2020-01-17 22:16:45 +0100 |
commit | c1f3a31b513e90b29f31f23ba24e5856837ea6d4 (patch) | |
tree | 8c3ef1be5a0bd4fa904311e8f1fc24de22646d62 /src/drivers/SpiMaster.h | |
parent | 69a14a224780a3abe13bc4fcacd2d71db54716ac (diff) |
Disable SPI, I²C, touch controller and display controller in sleep mode.
Re-enable them on wake up.
Remove delays that were not needed in st7889 driver.
Hopefully, it'll improve the battery life!
Diffstat (limited to 'src/drivers/SpiMaster.h')
-rw-r--r-- | src/drivers/SpiMaster.h | 6 |
1 files changed, 6 insertions, 0 deletions
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; }; } } |