| Nordic Thingy:52 v2.0.0

Data Structures | Enumerations | Functions
CCS811 gas sensor
Drivers » Gas sensor

CCS811 series ultra-low power digital gas sensor API. More...

## Data Structures

struct | drv_ccs811_alg_result_t
| The algorithm result data of the CCS811 device. More...
struct | drv_ccs811_cfg_t
| CCS811 configuration. More...

## Enumerations

enum | { DRV_CCS811_STATUS_CODE_SUCCESS, DRV_CCS811_STATUS_CODE_DISALLOWED, DRV_CCS811_STATUS_CODE_INVALID_PARAM, DRV_CCS811_STATUS_CODE_NOT_SUPPORTED }
| The CCS811 status codes. More...
enum | drv_ccs811_alg_result_descr_t { DRV_CCS811_ALG_RESULT_DESCR_ECO2_ONLY = 0, DRV_CCS811_ALG_RESULT_DESCR_TVOC_ONLY, DRV_CCS811_ALG_RESULT_DESCR_ECO2_TVOC, DRV_CCS811_ALG_RESULT_DESCR_ECO2_TVOC_STAT, DRV_CCS811_ALG_RESULT_DESCR_ALL }
| Descriptor of the CCS811 result data format. More...

## Functions

uint32_t | drv_ccs811_alg_result_data_get (drv_ccs811_alg_result_descr_t alg_result_descr, drv_ccs811_alg_result_t *p_alg_result_data)
| Function for getting the calculation result data of the CCS811 device. More...
uint32_t | drv_ccs811_app_start (void)
| Function for starting the application of the CCS811 device. More...
uint32_t | drv_ccs811_baseline_get (uint16_t *p_baseline)
| Function for getting the baseline value from the CCS811 device. More...
uint32_t | drv_ccs811_baseline_set (uint16_t baseline)
| Function for writing the baseline value to the CCS811 device. More...
uint32_t | drv_ccs811_close (void)
| Function for closing the CCS811 driver. More...
uint32_t | drv_ccs811_env_data_set (uint16_t rh_ppth, int32_t temp_mdeg)
| Function for setting the environmental data of the CCS811 device. More...
uint32_t | drv_ccs811_err_id_get (uint8_t *p_err_id)
| Function for getting the error identifier of the CCS811 device. More...
uint32_t | drv_ccs811_fw_app_version_get (uint16_t *p_fw_app_version)
| Function for getting the version of the firmware application of the CCS811 device. More...
uint32_t | drv_ccs811_fw_boot_version_get (uint16_t *p_fw_boot_version)
| Function for getting the version of the firmware bootloader of the CCS811 device. More...
uint32_t | drv_ccs811_hw_id_get (uint8_t *p_hw_id)
| Function for getting the hardware identity of the CCS811 device. More...
uint32_t | drv_ccs811_hw_version_get (uint8_t *p_hw_version)
| Function for getting the hardware version of the CCS811 device. More...
void | drv_ccs811_init (void)
| Function for initializing the CCS811 driver.
uint32_t | drv_ccs811_meas_mode_get (uint8_t *p_meas_mode)
| Function for getting the measurement mode of the CCS811 device. More...
uint32_t | drv_ccs811_meas_mode_modify (uint8_t set_mask, uint8_t clr_mask)
| Function for modifying the measurement mode register of the CCS811 device. More...
uint32_t | drv_ccs811_ntc_get (uint16_t *p_r_ref_mv, uint16_t *p_r_ntc_mv)
| Function for getting the NTC data of the CCS811 device. More...
uint32_t | drv_ccs811_open (drv_ccs811_cfg_t const *const p_drv_ccs811_cfg)
| Function for opening the CCS811 driver according to the specified configuration. More...
uint32_t | drv_ccs811_raw_data_get (uint16_t *p_raw_data)
| Function for getting the raw data of the CCS811 device. More...
uint32_t | drv_ccs811_status_get (uint8_t *p_status)
| Function for getting the status of the CCS811 device. More...
uint32_t | drv_ccs811_sw_reset (void)
| Function for starting the application of the CCS811 device. More...
uint32_t | drv_ccs811_thresholds_get (uint16_t *p_low_to_medium, uint16_t *p_medium_to_high, uint8_t *p_hysteresis)
| Function for the thresholds of the CCS811 device. More...
uint32_t | drv_ccs811_thresholds_set (uint16_t low_to_medium, uint16_t medium_to_highm, uint8_t hysteresis)
| Function for setting the thresholds of the CCS811 device. More...

## Detailed Description

CCS811 series ultra-low power digital gas sensor API.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

The CCS811 status codes.

Enumerator
DRV_CCS811_STATUS_CODE_SUCCESS | Successful.
DRV_CCS811_STATUS_CODE_DISALLOWED | Disallowed.
DRV_CCS811_STATUS_CODE_INVALID_PARAM | Invalid parameters.
DRV_CCS811_STATUS_CODE_NOT_SUPPORTED | Not supported.

## ◆ drv_ccs811_alg_result_descr_t

enum drv_ccs811_alg_result_descr_t

Descriptor of the CCS811 result data format.

Enumerator
DRV_CCS811_ALG_RESULT_DESCR_ECO2_ONLY | Only the equivalent CO2 (eCO2) value.
DRV_CCS811_ALG_RESULT_DESCR_TVOC_ONLY | Only the Total Volatile Organic Compound (TVOC) value.
DRV_CCS811_ALG_RESULT_DESCR_ECO2_TVOC | Both eCO2 and TVOC values, but no additional information.
DRV_CCS811_ALG_RESULT_DESCR_ECO2_TVOC_STAT | Both eCO2 and TVOC values + status.
DRV_CCS811_ALG_RESULT_DESCR_ALL | All available result data (eCO2 and TVOC, status, error ID, and raw data).

## Function Documentation

## ◆ drv_ccs811_alg_result_data_get()

uint32_t drv_ccs811_alg_result_data_get | ( | drv_ccs811_alg_result_descr_t | alg_result_descr,
|  | drv_ccs811_alg_result_t * | p_alg_result_data
| ) |  |

Function for getting the calculation result data of the CCS811 device.

Parameters

  [in] | alg_result_descr | Descriptor for the format of the result (i.e. what values are requested).
  [in] | p_alg_result_data | Pointer to where the calculation result data is to be stored.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
  DRV_CCS811_STATUS_CODE_INVALID_PARAM If specified masks overlap.

## ◆ drv_ccs811_app_start()

uint32_t drv_ccs811_app_start | ( | void |  | ) |

Function for starting the application of the CCS811 device.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_baseline_get()

uint32_t drv_ccs811_baseline_get | ( | uint16_t * | p_baseline | ) |

Function for getting the baseline value from the CCS811 device.

Parameters

  [out] | p_baseline | Pointer to value.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_baseline_set()

uint32_t drv_ccs811_baseline_set | ( | uint16_t | baseline | ) |

Function for writing the baseline value to the CCS811 device.

Parameters

  [in] | baseline | Value to write.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_close()

uint32_t drv_ccs811_close | ( | void |  | ) |

Function for closing the CCS811 driver.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_env_data_set()

uint32_t drv_ccs811_env_data_set | ( | uint16_t | rh_ppth,
|  | int32_t | temp_mdeg
| ) |  |

Function for setting the environmental data of the CCS811 device.

Parameters

  [in] | rh_ppth | Relative humidity in parts per thousand.
  [in] | temp_mdeg | Temperature in millidegrees Centigrade.

Note
  Environmental data may only be written to and not read from the sensor. drv_ccs811_env_data_get does not exist.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_err_id_get()

uint32_t drv_ccs811_err_id_get | ( | uint8_t * | p_err_id | ) |

Function for getting the error identifier of the CCS811 device.

Parameters

  [in] | p_err_id | Pointer to where the error identifier is to be stored.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_fw_app_version_get()

uint32_t drv_ccs811_fw_app_version_get | ( | uint16_t * | p_fw_app_version | ) |

Function for getting the version of the firmware application of the CCS811 device.

Parameters

  [in] | p_fw_app_version | Pointer to where the hardware identity is to be stored.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_fw_boot_version_get()

uint32_t drv_ccs811_fw_boot_version_get | ( | uint16_t * | p_fw_boot_version | ) |

Function for getting the version of the firmware bootloader of the CCS811 device.

Parameters

  [in] | p_fw_boot_version | Pointer to where the hardware identity is to be stored.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_hw_id_get()

uint32_t drv_ccs811_hw_id_get | ( | uint8_t * | p_hw_id | ) |

Function for getting the hardware identity of the CCS811 device.

Parameters

  [in] | p_hw_id | Pointer to where the hardware identity is to be stored.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_hw_version_get()

uint32_t drv_ccs811_hw_version_get | ( | uint8_t * | p_hw_version | ) |

Function for getting the hardware version of the CCS811 device.

Parameters

  [in] | p_hw_version | Pointer to where the hardware version is to be stored.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_meas_mode_get()

uint32_t drv_ccs811_meas_mode_get | ( | uint8_t * | p_meas_mode | ) |

Function for getting the measurement mode of the CCS811 device.

Parameters

  [in] | p_meas_mode | Pointer to where the status is to be stored.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_meas_mode_modify()

uint32_t drv_ccs811_meas_mode_modify | ( | uint8_t | set_mask,
|  | uint8_t | clr_mask
| ) |  |

Function for modifying the measurement mode register of the CCS811 device.

Parameters

  [in] | set_mask | A mask specifying which bits to set.
  [in] | clr_mask | A mask specifying which bits to clear.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.
  DRV_CCS811_STATUS_CODE_INVALID_PARAM If specified masks overlap.

## ◆ drv_ccs811_ntc_get()

uint32_t drv_ccs811_ntc_get | ( | uint16_t * | p_r_ref_mv,
|  | uint16_t * | p_r_ntc_mv
| ) |  |

Function for getting the NTC data of the CCS811 device.

Parameters

  [in] | p_r_ref_mv | Pointer to where the voltage (in millivolt) over the reference resistor is to be stored.
  [in] | p_r_ntc_mv | Pointer to where the voltage (in millivolt) over the NTC resistor is to be stored.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_open()

uint32_t drv_ccs811_open | ( | drv_ccs811_cfg_t const *const | p_drv_ccs811_cfg | ) |

Function for opening the CCS811 driver according to the specified configuration.

Parameters

  [in] | p_drv_ccs811_cfg | Pointer to the driver configuration for the session to be opened.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_raw_data_get()

uint32_t drv_ccs811_raw_data_get | ( | uint16_t * | p_raw_data | ) |

Function for getting the raw data of the CCS811 device.

Parameters

  [in] | p_raw_data | Pointer to where the raw data is to be stored.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_status_get()

uint32_t drv_ccs811_status_get | ( | uint8_t * | p_status | ) |

Function for getting the status of the CCS811 device.

Parameters

  [in] | p_status | Pointer to where the status is to be stored.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_sw_reset()

uint32_t drv_ccs811_sw_reset | ( | void |  | ) |

Function for starting the application of the CCS811 device.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_thresholds_get()

uint32_t drv_ccs811_thresholds_get | ( | uint16_t * | p_low_to_medium,
|  | uint16_t * | p_medium_to_high,
|  | uint8_t * | p_hysteresis
| ) |  |

Function for the thresholds of the CCS811 device.

Parameters

  [in] | p_low_to_medium | Pointer to where the low to medium threshold is to be stored.
  [in] | p_medium_to_high | Pointer to where the medium to high threshold is to be stored.
  [in] | p_hysteresis | Pointer to where the hysteresis value is to be stored.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.

## ◆ drv_ccs811_thresholds_set()

uint32_t drv_ccs811_thresholds_set | ( | uint16_t | low_to_medium,
|  | uint16_t | medium_to_highm,
|  | uint8_t | hysteresis
| ) |  |

Function for setting the thresholds of the CCS811 device.

Parameters

  [in] | low_to_medium | The low to medium threshold.
  [in] | medium_to_highm | The medium to high threshold.
  [in] | hysteresis | The hysteresis value.

Returns
  DRV_CCS811_STATUS_CODE_SUCCESS If the call was successful.
  DRV_CCS811_STATUS_CODE_DISALLOWED If the call was not allowed at this time.