41#ifdef PREINIT_SUPPORTED
45#ifdef MikroCCoreVersion
46 #if MikroCCoreVersion >= 1
51#include "drv_digital_out.h"
52#include "drv_digital_in.h"
53#include "drv_analog_in.h"
65#define POLLUTION_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.an_pin = MIKROBUS( mikrobus, MIKROBUS_AN ); \
67 cfg.ena = MIKROBUS( mikrobus, MIKROBUS_RST )
74#define POLLUTION_RETVAL uint8_t
76#define POLLUTION_OK 0x00
77#define POLLUTION_INIT_ERROR 0xFF
#define POLLUTION_RETVAL
Definition pollution.h:74
void pollution_disable(pollution_t *ctx)
Disable sensor function.
void pollution_reset(pollution_t *ctx)
Reset sensor function.
float pollution_get_resistance(pollution_t *ctx)
Get the resistance of the sensor function.
POLLUTION_RETVAL pollution_init(pollution_t *ctx, pollution_cfg_t *cfg)
Initialization function.
void pollution_cfg_setup(pollution_cfg_t *cfg)
Config Object Initialization function.
pollution_data_t pollution_generic_read(pollution_t *ctx)
Generic read function.
void pollution_enable(pollution_t *ctx)
Enable sensor function.
float pollution_get_corrected_resistance(pollution_t *ctx)
Get the corrected resistance of the sensor function.
void pollution_default_cfg(pollution_t *ctx)
Click Default Configuration function.
float pollution_measure_load_voltage(pollution_t *ctx)
Measure load voltage form ADC function.
uint16_t pollution_data_t
Analog data type.
Definition pollution.h:91
Click configuration structure definition.
Definition pollution.h:112
analog_in_resolution_t resolution
Definition pollution.h:123
float vref
Definition pollution.h:124
pin_name_t ena
Definition pollution.h:119
pin_name_t an_pin
Definition pollution.h:115
Click ctx object definition.
Definition pollution.h:97
digital_out_t ena
Definition pollution.h:100
analog_in_t adc
Definition pollution.h:104