zephyr/drivers/sensor/ccs811
Peter A. Bigot 29c5f30ed2 drivers: sensor: ccs811: rework data fetch to prepare for non-polled use
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>
2020-01-14 15:44:09 -06:00
..
ccs811.c drivers: sensor: ccs811: rework data fetch to prepare for non-polled use 2020-01-14 15:44:09 -06:00
ccs811.h drivers: sensor: ccs811: abstract read of status/error 2020-01-14 15:44:09 -06:00
CMakeLists.txt license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
Kconfig drivers: sensor: ccs811: make measurement drive mode configurable 2020-01-14 15:44:09 -06:00