summaryrefslogtreecommitdiff
path: root/src/drivers/Bma421.h
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-04-08 18:07:24 (GMT)
committerJean-François Milants <jf@codingfield.com>2021-04-08 18:07:24 (GMT)
commit9ac4be8b759bb2cedeb999ce5e87d983261beded (patch)
tree2a5fabd9b7505976c20b5512f9335e75290bdd86 /src/drivers/Bma421.h
parent1d7576de64a33837434e6f414a74ae7dbe929196 (diff)
TwiMaster is now based on the NRFX TWI driver, as it handles more edge cases and workarounds for errors on the bus.
Reset the TWI bus after the soft-reset of the motion sensor to workaround issues on the TWI bus.
Diffstat (limited to 'src/drivers/Bma421.h')
-rw-r--r--src/drivers/Bma421.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/drivers/Bma421.h b/src/drivers/Bma421.h
index d36d1db..da021cb 100644
--- a/src/drivers/Bma421.h
+++ b/src/drivers/Bma421.h
@@ -18,6 +18,9 @@ namespace Pinetime {
Bma421(Bma421&&) = delete;
Bma421& operator=(Bma421&&) = delete;
+ /// The chip freezes the TWI bus after the softreset operation. Softreset is separated from the
+ /// Init() method to allow the caller to uninit and then reinit the TWI device after the softreset.
+ void SoftReset();
void Init();
Values Process();
void ResetStepCounter();
@@ -34,6 +37,7 @@ namespace Pinetime {
uint8_t deviceAddress = 0x18;
struct bma4_dev bma;
bool isOk = false;
+ bool isResetOk = false;
};
}
} \ No newline at end of file