Use power saving mode on MAX17043 when entering deepsleep #19709
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
The MAX17043 has a power save mode that can be enabled via a configuration command. This PR takes advantage of this when entering deep sleep and then disables it on restart. It's worth noting that when in power save mode the voltage on the battery isn't actively measured of course but the battery modeling scheme picks up where it left off on restart. This retains the advantages discussed in #19412 which assumes power is maintained to the MAX17043 during deep sleep and the long term battery behaviour can be 'learnt'.
I've seen a dramatic reduction is current draw in tests - a DFRobot ESP32 Firebeetle with DFRobot MAX17043 battery gauge breakout board current draw decreased from 430µA to 10µA.
I've tested on ESP32 but don't have the hardware to test on 8266 (although it builds).
add: use power saving mode when entering deepsleep
Related issue (if applicable): fixes # n/a
Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass