From 4c0f897953aa8d478f3c941e75d3b2eb5611531d Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Sun, 7 May 2023 18:24:34 +0200 Subject: Power optimization - Improve SPI sleep mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/drivers/Spi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/drivers/Spi.cpp') diff --git a/src/drivers/Spi.cpp b/src/drivers/Spi.cpp index e477622b..c85b90c1 100644 --- a/src/drivers/Spi.cpp +++ b/src/drivers/Spi.cpp @@ -27,7 +27,8 @@ bool Spi::WriteCmdAndBuffer(const uint8_t* cmd, size_t cmdSize, const uint8_t* d } bool Spi::Init() { - nrf_gpio_pin_set(pinCsn); /* disable Set slave select (inactive high) */ + nrf_gpio_cfg_output(pinCsn); + nrf_gpio_pin_set(pinCsn); return true; } -- cgit v1.2.3-70-g09d2