Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
CCS811 Class Reference

CCS811 gas sensor with cached eCO2 and TVOC results. Call begin(), allow measurements to accumulate, then readAlgorithmResults() before reading the cached getters. The driver does not report transport failures. More...

#include <SparkFun_CCS811.hpp>

Inheritance diagram for CCS811:
CCS811Core

Public Member Functions

 CCS811 (TwoWire &, uint8_t addr)
 Bind the I2C bus and 7-bit sensor address.
status begin (void)
 Initialize I2C, start the application, and select drive mode 1.
status setDriveMode (uint8_t mode)
 Set the measurement mode field; values above 4 are clamped to 4.
status readAlgorithmResults (void)
 Read algorithm registers and update cached eCO2/TVOC.
bool dataAvailable (void)
 Legacy readiness declaration without an implementation; do not call.
uint16_t getTVOC (void)
 Return cached total volatile organic compounds in ppb.
uint16_t getCO2e (void)
 Return cached equivalent CO2 concentration in ppm.
Public Member Functions inherited from CCS811Core
 CCS811Core (TwoWire &, uint8_t addr)
 Bind the I2C bus and 7-bit sensor address.
 ~CCS811Core ()=default
 Destroy the transport wrapper without taking ownership of the bus.
status beginCore (void)
 Legacy initialization declaration without an implementation; use CCS811::begin().
status readRegister (uint8_t offset, uint8_t *outputPointer)
 Read one register into outputPointer; storage must be non-null.
status multiReadRegister (uint8_t offset, uint8_t *outputPointer, uint8_t length)
status writeRegister (uint8_t offset, uint8_t dataToWrite)
 Write dataToWrite to the register at offset.
status multiWriteRegister (uint8_t offset, uint8_t *inputPointer, uint8_t length)
 Write length bytes from inputPointer starting at offset.

Additional Inherited Members

Public Types inherited from CCS811Core
enum  status {
  SENSOR_SUCCESS , SENSOR_ID_ERROR , SENSOR_I2C_ERROR , SENSOR_INTERNAL_ERROR ,
  SENSOR_GENERIC_ERROR
}
 Status codes returned by register and sensor operations. More...
Protected Attributes inherited from CCS811Core
TwoWire & Wire
uint8_t I2CAddress

Detailed Description

CCS811 gas sensor with cached eCO2 and TVOC results. Call begin(), allow measurements to accumulate, then readAlgorithmResults() before reading the cached getters. The driver does not report transport failures.

Member Function Documentation

◆ begin()

status CCS811::begin ( void )

Initialize I2C, start the application, and select drive mode 1.

Returns
SENSOR_SUCCESS in the current implementation; no device ID validation.

◆ readAlgorithmResults()

status CCS811::readAlgorithmResults ( void )

Read algorithm registers and update cached eCO2/TVOC.

Returns
SENSOR_SUCCESS in the current implementation.

The documentation for this class was generated from the following file: