Nordic Thingy:52
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Gas sensor

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)
 Reads the baseline value from the gas sensor. More...
 
ret_code_t drv_gas_sensor_baseline_set (uint16_t baseline)
 Writes baseline value to the gas sensor. More...
 
ret_code_t drv_gas_sensor_calibrate_humid_temp (uint16_t rh_ppth, int32_t temp_mdeg)
 Calibrates the gas sensor based on the ambient humidity and temperature. More...
 
ret_code_t drv_gas_sensor_init (drv_gas_init_t *p_init)
 Initializes the the gas sensor. More...
 
ret_code_t drv_gas_sensor_raw_data_get (uint8_t *p_current_selected, uint16_t *p_raw_adc_reading)
 Writes baseline value to the gas sensor. More...
 
ret_code_t drv_gas_sensor_start (drv_gas_sensor_mode_t mode)
 Starts data acquisition from the the gas sensor. More...
 
ret_code_t drv_gas_sensor_stop (void)
 Stops data acquisition from the the gas sensor. More...
 

Detailed Description

Digital gas sensor API.

Function Documentation

ret_code_t drv_gas_sensor_baseline_get ( uint16_t *  p_baseline)

Reads the baseline value from the gas sensor.

Parameters
[out]p_baselineBaseline value read from the sensor.
Returns
NRF_SUCCESS If the call was successful.
Other codes from the underlying driver(s).
ret_code_t drv_gas_sensor_baseline_set ( uint16_t  baseline)

Writes baseline value to the gas sensor.

Parameters
[in]baselineBaseline value for writing to the sensor.
Returns
NRF_SUCCESS If the call was successful.
Other codes from the underlying driver(s).
ret_code_t drv_gas_sensor_calibrate_humid_temp ( uint16_t  rh_ppth,
int32_t  temp_mdeg 
)

Calibrates the gas sensor based on the ambient humidity and temperature.

Parameters
[in]rh_ppthRelative humidity in parts per thousand (ppt).
[in]temp_mdegTemperature in millidegrees Centigrade.
Returns
NRF_SUCCESS If the call was successful.
Other codes from the underlying driver(s).
ret_code_t drv_gas_sensor_init ( drv_gas_init_t p_init)

Initializes the the gas sensor.

Parameters
[in]p_initPointer with configuration parameters.
Returns
NRF_SUCCESS If the call was successful.
Other codes from the underlying driver(s).
ret_code_t drv_gas_sensor_raw_data_get ( uint8_t *  p_current_selected,
uint16_t *  p_raw_adc_reading 
)

Writes baseline value to the gas sensor.

Parameters
[out]p_current_selectedThe current trough the sensor [uA] (0 to 63 uA).
[out]p_raw_adc_readingRaw ADC read (0 to 1023).
Returns
NRF_SUCCESS If the call was successful.
Other codes from the underlying driver(s).
ret_code_t drv_gas_sensor_start ( drv_gas_sensor_mode_t  mode)

Starts data acquisition from the the gas sensor.

Parameters
[in]modeThe given mode (frequency) of sensor reads.
Returns
NRF_SUCCESS If the call was successful.
Other codes from the underlying driver(s).
ret_code_t drv_gas_sensor_stop ( void  )

Stops 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 driver(s).