diff options
| author | JF <jf@codingfield.com> | 2020-01-17 21:16:45 (GMT) |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-01-17 21:16:45 (GMT) |
| commit | c1f3a31b513e90b29f31f23ba24e5856837ea6d4 (patch) | |
| tree | 8c3ef1be5a0bd4fa904311e8f1fc24de22646d62 /src/drivers/Cst816s.cpp | |
| 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/Cst816s.cpp')
| -rw-r--r-- | src/drivers/Cst816s.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index 8ed6587..67700f5 100644 --- a/src/drivers/Cst816s.cpp +++ b/src/drivers/Cst816s.cpp @@ -75,3 +75,13 @@ Cst816S::TouchInfos Cst816S::GetTouchInfo() { info.action = action; return info; } + +void Cst816S::Sleep() { + nrfx_twi_disable(&twi); + nrf_gpio_cfg_default(6); + nrf_gpio_cfg_default(7); +} + +void Cst816S::Wakeup() { + Init(); +} |
