pollution 2.0.0.0
Public function

Functions

void pollution_cfg_setup (pollution_cfg_t *cfg)
 Config Object Initialization function.
 
POLLUTION_RETVAL pollution_init (pollution_t *ctx, pollution_cfg_t *cfg)
 Initialization function.
 
void pollution_default_cfg (pollution_t *ctx)
 Click Default Configuration function.
 
pollution_data_t pollution_generic_read (pollution_t *ctx)
 Generic read function.
 
void pollution_enable (pollution_t *ctx)
 Enable sensor function.
 
void pollution_disable (pollution_t *ctx)
 Disable sensor function.
 
void pollution_reset (pollution_t *ctx)
 Reset sensor function.
 
float pollution_measure_load_voltage (pollution_t *ctx)
 Measure load voltage form ADC function.
 
float pollution_get_resistance (pollution_t *ctx)
 Get the resistance of the sensor function.
 
float pollution_get_corrected_resistance (pollution_t *ctx)
 Get the corrected resistance of the sensor function.
 

Detailed Description

Function Documentation

◆ pollution_cfg_setup()

void pollution_cfg_setup ( pollution_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ pollution_default_cfg()

void pollution_default_cfg ( pollution_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Pollution click.

Note

Click default configuration:

   Enable the WSP2110 sensor on Pollution Click Board.
   Reset the WSP2110 sensor on Pollution Click Board.

◆ pollution_disable()

void pollution_disable ( pollution_t * ctx)

Disable sensor function.

Parameters
ctxClick object.

@description This function disable the WSP2110 sensor by set ENA pin on Pollution Click Board.

◆ pollution_enable()

void pollution_enable ( pollution_t * ctx)

Enable sensor function.

Parameters
ctxClick object.

@description This function enable the WSP2110 sensor by set ENA pin on Pollution Click Board.

◆ pollution_generic_read()

pollution_data_t pollution_generic_read ( pollution_t * ctx)

Generic read function.

Parameters
ctxClick object.
Returns
ADC data

@description This function read ADC data.

◆ pollution_get_corrected_resistance()

float pollution_get_corrected_resistance ( pollution_t * ctx)

Get the corrected resistance of the sensor function.

Parameters
ctxClick object.
Returns
Resault ( float value of the corrected sensor resistance kOhm ).

@description This function get the corrected resistance of the sensor, ie. measurement adc value of the WSP2110 sensor on Pollution Click Board.

◆ pollution_get_resistance()

float pollution_get_resistance ( pollution_t * ctx)

Get the resistance of the sensor function.

Parameters
ctxClick object.
Returns
Resault ( float value of the sensor resistance in kOhm ).

@description This function get the resistance of the sensor, ie. measurement ADC value of the WSP2110 sensor on Pollution Click Board.

◆ pollution_init()

POLLUTION_RETVAL pollution_init ( pollution_t * ctx,
pollution_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ pollution_measure_load_voltage()

float pollution_measure_load_voltage ( pollution_t * ctx)

Measure load voltage form ADC function.

Parameters
ctxClick object.
Returns
Resault ( float value of the load voltage ).

@description This function get load voltage from read ADC value of the WSP2110 sensor on Pollution Click Board.

◆ pollution_reset()

void pollution_reset ( pollution_t * ctx)

Reset sensor function.

Parameters
ctxClick object.

@description Function reset the WSP2110 sensor by set ENA pin, wait and clear ENA pin on Pollution Click Board.

@note

   Inside Reset function exists two delays of 100ms.