co_2  2.0.0.0
Data Structures | Macros | Functions
co2.h File Reference

This file contains API for CO 2 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  co2_t
 Click ctx object definition. More...
 
struct  co2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define CO2_MAP_MIKROBUS(cfg, mikrobus)
 
#define CO2_RETVAL   uint8_t
 
#define CO2_OK   0x00
 
#define CO2_INIT_ERROR   0xFF
 
#define CO2_STATUS_REG   0x00
 
#define CO2_LOCK_REG   0x01
 
#define CO2_TIACN_REG   0x10
 
#define CO2_REFCN_REG   0x11
 
#define CO2_MODECN_REG   0x12
 
#define CO2_WRITE_MODE   0x00
 
#define CO2_READ_ONLY_MODE   0x01
 
#define CO2_EXT_TIA_RES   0x00
 
#define CO2_2750_OHM_TIA_RES   0x04
 
#define CO2_3500_OHM_TIA_RES   0x08
 
#define CO2_7K_OHM_TIA_RES   0x0C
 
#define CO2_14K_OHM_TIA_RES   0x10
 
#define CO2_35K_OHM_TIA_RES   0x14
 
#define CO2_120K_OHM_TIA_RES   0x18
 
#define CO2_350K_OHM_TIA_RES   0x1C
 
#define CO2_10_OHM_LOAD_RES   0x00
 
#define CO2_33_OHM_LOAD_RES   0x01
 
#define CO2_50_OHM_LOAD_RES   0x02
 
#define CO2_100_OHM_LOAD_RES   0x03
 
#define CO2_VREF_INT   0x00
 
#define CO2_VREF_EXT   0x80
 
#define CO2_20_PERCENTS_INT_ZERO   0x00
 
#define CO2_50_PERCENTS_INT_ZERO   0x20
 
#define CO2_67_PERCENTS_INT_ZERO   0x40
 
#define CO2_INT_ZERO_BYPASSED   0x60
 
#define CO2_BIAS_POL_NEGATIVE   0x00
 
#define CO2_BIAS_POL_POSITIVE   0x10
 
#define CO2_0_PERCENTS_BIAS   0x00
 
#define CO2_1_PERCENT_BIAS   0x01
 
#define CO2_2_PERCENTS_BIAS   0x02
 
#define CO2_4_PERCENTS_BIAS   0x03
 
#define CO2_6_PERCENTS_BIAS   0x04
 
#define CO2_8_PERCENTS_BIAS   0x05
 
#define CO2_10_PERCENTS_BIAS   0x06
 
#define CO2_12_PERCENTS_BIAS   0x07
 
#define CO2_14_PERCENTS_BIAS   0x08
 
#define CO2_16_PERCENTS_BIAS   0x09
 
#define CO2_18_PERCENTS_BIAS   0x0A
 
#define CO2_20_PERCENTS_BIAS   0x0B
 
#define CO2_22_PERCENTS_BIAS   0x0C
 
#define CO2_24_PERCENTS_BIAS   0x0D
 
#define CO2_FET_DIS   0x00
 
#define CO2_FET_EN   0x80
 
#define CO2_DEEP_SLEEP_MODE   0x00
 
#define CO2_2_LEAD_MODE   0x01
 
#define CO2_STANDBY_MODE   0x02
 
#define CO2_3_LEAD_MODE   0x03
 
#define CO2_TEMP_MODE_TIA_OFF   0x06
 
#define CO2_TEMP_MODE_TIA_ON   0x07
 
#define CO2_DEVICE_EN   0x00
 
#define CO2_DEVICE_DIS   0x01
 
#define ADC_DEVICE_ADDR   0x4D
 

Functions

void co2_cfg_setup (co2_cfg_t *cfg)
 Config Object Initialization function. More...
 
CO2_RETVAL co2_init (co2_t *ctx, co2_cfg_t *cfg)
 Initialization function. More...
 
uint8_t co2_generic_write (co2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
uint8_t co2_generic_read (co2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
void co2_wait_i2c_ready (co2_t *ctx)
 Generic read function. More...
 
void co2_enable (co2_t *ctx, uint8_t state)
 Device Enable function. More...
 
void co2_read_adc (co2_t *ctx, uint16_t *data_out)
 Read ADC Data function. More...
 
void co2_get_co2_ppm (co2_t *ctx, float *co2_data)
 Get CO Data function. More...
 

Detailed Description

This file contains API for CO 2 Click driver.