The softReset function only clears the SW_RST bit after initiating a soft reset. I believe it should reset all four shadow registers to zero. According to the datasheet:
Writing “1”will cause the part to reset, similar to power-up. It will clear all registers and also re-read OTP as part of its startup routine. The power on time is 10mS.
|
bool SFE_MMC5983MA::softReset() |
|
{ |
|
// Set the SW_RST bit to perform a software reset. |
|
// Do this using the shadow register. If we do it with setRegisterBit |
|
// (read-modify-write) we end up setting the reserved and BW_0 bits too as they |
|
// always seems to read as 1...? I don't know why. |
|
bool success = setShadowBit(INT_CTRL_1_REG, SW_RST); |
|
|
|
clearShadowBit(INT_CTRL_1_REG, SW_RST, false); // Clear the bit - in shadow memory only |
|
|
|
// The reset time is 10 msec. but we'll wait 15 msec. just in case. |
|
delay(15); |
|
|
|
return success; |
|
} |
The
softResetfunction only clears theSW_RSTbit after initiating a soft reset. I believe it should reset all four shadow registers to zero. According to the datasheet:SparkFun_MMC5983MA_Magnetometer_Arduino_Library/src/SparkFun_MMC5983MA_Arduino_Library.cpp
Lines 281 to 295 in 8b22bc4