| Nordic Thingy:52 v2.0.0

Modules | Data Structures | Typedefs | Enumerations | Functions
Gas sensor
Drivers

Digital gas sensor API. More...

## Modules

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

## Data Structures

struct | drv_gas_init_t
| Gas sensor init struct. More...

## Typedefs

typedef void(* | drv_gas_sensor_data_handler_t) (drv_gas_sensor_data_t const *p_evt)
| Gas sensor driver event handler callback type.
typedef drv_ccs811_alg_result_t | drv_gas_sensor_data_t
| Struct for holding the measurement results.

## Enumerations

enum | drv_gas_sensor_mode_t
| Gas sensor measurement intervals.

## Functions

ret_code_t | drv_gas_sensor_baseline_get (uint16_t *p_baseline)
| Function for reading a baseline value from the gas sensor. More...
ret_code_t | drv_gas_sensor_baseline_set (uint16_t baseline)
| Function for writing a baseline value to the gas sensor. More...
ret_code_t | drv_gas_sensor_calibrate_humid_temp (uint16_t rh_ppth, int32_t temp_mdeg)
| Function for calibrating the gas sensor based on the ambient humidity and temperature. More...
ret_code_t | drv_gas_sensor_init (drv_gas_init_t *p_init)
| Function for initializing the gas sensor. More...
ret_code_t | drv_gas_sensor_raw_data_get (uint8_t *p_current_selected, uint16_t *p_raw_adc_reading)
| Function for getting a baseline value from the gas sensor. More...
ret_code_t | drv_gas_sensor_start (drv_gas_sensor_mode_t mode)
| Function for starting data acquisition from the the gas sensor. More...
ret_code_t | drv_gas_sensor_stop (void)
| Function for stopping data acquisition from the the gas sensor. More...

## Detailed Description

Digital gas sensor API.

## Function Documentation

## ◆ drv_gas_sensor_baseline_get()

ret_code_t drv_gas_sensor_baseline_get | ( | uint16_t * | p_baseline | ) |

Function for reading a baseline value from the gas sensor.

Parameters

  [out] | p_baseline | Baseline value read from the sensor.

Returns
  NRF_SUCCESS If the call was successful.
  Other codes from the underlying drivers.

## ◆ drv_gas_sensor_baseline_set()

ret_code_t drv_gas_sensor_baseline_set | ( | uint16_t | baseline | ) |

Function for writing a baseline value to the gas sensor.

Parameters

  [in] | baseline | Baseline value for writing to the sensor.

Returns
  NRF_SUCCESS If the call was successful.
  Other codes from the underlying drivers.

## ◆ drv_gas_sensor_calibrate_humid_temp()

ret_code_t drv_gas_sensor_calibrate_humid_temp | ( | uint16_t | rh_ppth,
|  | int32_t | temp_mdeg
| ) |  |

Function for calibrating the gas sensor based on the ambient humidity and temperature.

Parameters

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

Returns
  NRF_SUCCESS If the call was successful.
  Other codes from the underlying drivers.

## ◆ drv_gas_sensor_init()

ret_code_t drv_gas_sensor_init | ( | drv_gas_init_t * | p_init | ) |

Function for initializing the gas sensor.

Parameters

  [in] | p_init | Pointer with configuration parameters.

Returns
  NRF_SUCCESS If the call was successful.
  Other codes from the underlying drivers.

## ◆ drv_gas_sensor_raw_data_get()

ret_code_t drv_gas_sensor_raw_data_get | ( | uint8_t * | p_current_selected,
|  | uint16_t * | p_raw_adc_reading
| ) |  |

Function for getting a baseline value from the gas sensor.

Parameters

  [out] | p_current_selected | The current through the sensor [uA] (0 to 63 uA).
  [out] | p_raw_adc_reading | Raw ADC read (0 to 1023).

Returns
  NRF_SUCCESS If the call was successful.
  Other codes from the underlying drivers.

## ◆ drv_gas_sensor_start()

ret_code_t drv_gas_sensor_start | ( | drv_gas_sensor_mode_t | mode | ) |

Function for starting data acquisition from the the gas sensor.

Parameters

  [in] | mode | The given mode (frequency) of sensor reads.

Returns
  NRF_SUCCESS If the call was successful.
  Other codes from the underlying drivers.

## ◆ drv_gas_sensor_stop()

ret_code_t drv_gas_sensor_stop | ( | void |  | ) |

Function for stopping data acquisition from the the gas sensor.

Returns
  NRF_SUCCESS If the call was successful.
  NRF_ERROR_NOT_SUPPORTED The mode is currently not supported.
  NRF_ERROR_INVALID_PARAM Invalid parameters supplied.
  NRF_ERROR_INVALID_STATE The sensor is in an invalid state.
  Other codes from the underlying drivers.