The original implementation relied on the DATA_READY bit of the STATUS register to indicate when a reading was available. This bit remains clear for the first several readings produced by the CCS811. When INT_DATARDY is set in MEAS_MODE the nINT signal will remain asserted until ALG_RESULT_DATA is read. If this is treated as a LEVEL signal, which is the common case in Zephyr, gating the read of ALG_RESULT_DATA on DATA_READY means the signal will never be cleared, and the interrupt callback will be repeated immediately. Since the STATUS register value is part of the ALG_RESULT_DATA block just read the whole thing, and provide its content to the user only if the DATA_READY bit is set. Signed-off-by: Peter A. Bigot <pab@pabigot.com> |
||
---|---|---|
.. | ||
ccs811.c | ||
ccs811.h | ||
CMakeLists.txt | ||
Kconfig |