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.
This commit is contained in:
Jean-François Milants
2021-04-08 20:07:24 +02:00
parent 1d7576de64
commit 9ac4be8b75
7 changed files with 67 additions and 207 deletions

View File

@@ -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;
};
}
}