aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/Spi.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/Spi.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/Spi.cpp')
-rw-r--r--src/drivers/Spi.cpp3
1 files changed, 2 insertions, 1 deletions
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;
}