ist8310: do reset before WHOAMI call (#23161)

* ist8310: do reset before WHOAMI call

Apparently, the IST8310's WHOAMI register is writeable. Presumably, this
can get corrupted by bus noise. It is only reset if powered off for 30s.

Therefore, we do a reset before doing the WHOAMI.

* ist8310: improve comment

Co-authored-by: Beat Küng <beat-kueng@gmx.net>

---------

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
This commit is contained in:
Julian Oes
2024-06-15 13:22:39 +12:00
committed by GitHub
parent f646f1ba98
commit 8258cd63ba
@@ -85,6 +85,15 @@ void IST8310::print_status()
int IST8310::probe()
{
// Apparently, the IST8310's WHOAMI register is writeable. Presumably,
// this can get corrupted by bus noise. It is only reset if powered off
// for 30s or by a reset.
//
// Therefore, we do a reset before doing the WHOAMI.
RegisterWrite(Register::CNTL2, CNTL2_BIT::SRST);
px4_usleep(10000);
const uint8_t WAI = RegisterRead(Register::WAI);
if (WAI != Device_ID) {