zephyr/samples/sensor/ccs811
Tomasz Bursztyka e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
..
boards samples: sensor: ccs811: Add board efr32mg_sltb004a 2020-07-08 15:31:03 -05:00
src device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
CMakeLists.txt samples: make find_package(Zephyr...) REQUIRED 2020-05-29 10:47:25 +02:00
Kconfig
README.rst boards: nrf52_pca20020: Rename to thingy52_nrf52832 2020-04-06 13:09:07 +02:00
prj.conf
sample.yaml sanitycheck: inclusive language 2020-08-27 07:04:07 -04:00

README.rst

.. _ccs811:

CCS811 Indoor Air Quality Sensor
################################

Overview
********

The CCS811 digital gas sensor detects volatile organic compounds (VOCs)
for indoor air quality measurements. VOCs are often categorized as
pollutants and/or sensory irritants and can come from a variety of
sources such as construction materials (paint and carpet), machines
(copiers and processors), and even people (breathing and smoking).  It
estimates carbon dioxide (CO2) levels where the main source of VOCs is
human presence.

Building and Running
********************

Building and Running on thingy52_nrf52832
=========================================

.. zephyr-app-commands::
   :zephyr-app: samples/sensor/ccs811
   :board: thingy52_nrf52832
   :goals: build flash
   :compact:


Sample Output
=============

The sample output below is from a `Nordic Thingy:52
<https://www.nordicsemi.com/Software-and-tools/Prototyping-platforms/Nordic-Thingy-52>`_
(thingy52_nrf52832) that includes this sensor (and others).
After a soft reset, there is a 5-second startup period
where readings are unstable, and then we can see steady
reported measurements of about 400 ppm eC02 and 0 ppb eTVOC.

.. code-block::console

   *** Booting Zephyr OS build zephyr-v2.1.0-310-g32a3e9907bab  ***
   device is 0x20001088, name is CCS811
   HW 12; FW Boot 1000 App 1100 ; mode 10

   [0:00:00.046]: CCS811: 65021 ppm eCO2; 65021 ppb eTVOC
   Voltage: 0.000000V; Current: 0.000000A
   BASELINE fff4
   Timed fetch got 0

   [0:00:01.059]: CCS811: 65021 ppm eCO2; 65021 ppb eTVOC
   Voltage: 0.000000V; Current: 0.000000A
   BASELINE fff4
   Timed fetch got 0
   Timed fetch got stale data
   Timed fetch got stale data
   Timed fetch got stale data

   [0:00:05.084]: CCS811: 400 ppm eCO2; 0 ppb eTVOC
   Voltage: 0.677040V; Current: 0.000014A
   BASELINE 8384
   Timed fetch got 0

   [0:00:06.096]: CCS811: 405 ppm eCO2; 0 ppb eTVOC
   Voltage: 0.675428V; Current: 0.000014A
   BASELINE 8384
   Timed fetch got 0

   [0:00:07.108]: CCS811: 400 ppm eCO2; 0 ppb eTVOC
   Voltage: 0.677040V; Current: 0.000014A
   BASELINE 8384
   Timed fetch got 0

   [0:00:08.121]: CCS811: 400 ppm eCO2; 0 ppb eTVOC
   Voltage: 0.677040V; Current: 0.000014A
   BASELINE 8384
   Timed fetch got 0

   [0:00:09.133]: CCS811: 400 ppm eCO2; 0 ppb eTVOC
   Voltage: 0.677040V; Current: 0.000014A
   BASELINE 8384
   Timed fetch got 0

   [0:00:10.145]: CCS811: 400 ppm eCO2; 0 ppb eTVOC
   Voltage: 0.677040V; Current: 0.000014A
   BASELINE 8384
   Timed fetch got 0