ndirco2 2.0.0.0
ndirco2.h File Reference

This file contains API for NDIR CO2 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  ndirco2_t
 Click ctx object definition. More...
 
struct  ndirco2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define NDIRCO2_MAP_MIKROBUS(cfg, mikrobus)
 
#define NDIRCO2_RETVAL   uint8_t
 
#define NDIRCO2_OK   0x00
 
#define NDIRCO2_INIT_ERROR   0xFF
 
#define NDIRCO2_SOFTWARE_RESET_REG   0x00
 
#define NDIRCO2_CONTROL_REG   0x01
 
#define NDIRCO2_STATUS_REG   0x02
 
#define NDIRCO2_DATA_LOW_REG   0x03
 
#define NDIRCO2_DATA_HIGH_REG   0x04
 
#define NDIRCO2_AVERAGING_COUNT_REG   0x07
 
#define NDIRCO2_HIGH_ALARM_THRESHOLD_REG   0x0C
 
#define NDIRCO2_LOW_ALARM_THRESHOLD_REG   0x0D
 
#define NDIRCO2_FUNCTION_REG   0x0F
 
#define NDIRCO2_NORMAL_STATE   0x00
 
#define NDIRCO2_RESET   0x01
 
#define NDIRCO2_MOVING_AVERAGE_SEL   0x00
 
#define NDIRCO2_IIR_DIGITAL_FILTER_SEL   0x04
 
#define NDIRCO2_MIN_AVG_COUNT_1_TIME   0x00
 
#define NDIRCO2_MAX_AVG_COUNT_64_TIMES   0x3F
 
#define NDIRCO2_PWM_PIN_DISABLE   0x00
 
#define NDIRCO2_PWM_PIN_ENABLE   0x01
 
#define NDIRCO2_PWM_HIGH_CONCENTRATION   0x00
 
#define NDIRCO2_PWM_LOW_CONCENTRATION   0x08
 
#define NDIRCO2_CHECK_EACH_MEASURE   0x00
 
#define NDIRCO2_CHECK_AVG_COMPLETED   0x01
 
#define NDIRCO2_POWER_DOWN_MODE   0x00
 
#define NDIRCO2_CONTINUOUS_OP_MODE   0x01
 

Functions

void ndirco2_cfg_setup (ndirco2_cfg_t *cfg)
 Config Object Initialization function.
 
NDIRCO2_RETVAL ndirco2_init (ndirco2_t *ctx, ndirco2_cfg_t *cfg)
 Initialization function.
 
void ndirco2_generic_write (ndirco2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void ndirco2_generic_read (ndirco2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t ndirco2_read_register (ndirco2_t *ctx, uint8_t register_address, uint16_t *data_out)
 Generic Read function.
 
uint8_t ndirco2_write_register (ndirco2_t *ctx, uint8_t register_address, uint8_t transfer_data)
 Generic Write function.
 
void ndirco2_read_current_address (ndirco2_t *ctx, uint8_t *data_out, uint8_t n_bytes)
 Current Address Read function.
 
void ndirco2_read_co2 (ndirco2_t *ctx, uint8_t set_check_mode, uint16_t *output_data)
 CO2 Concentration Read function.
 
uint8_t ndirco2_check_busy (ndirco2_t *ctx)
 Data Ready Check function.
 
uint8_t ndirco2_check_average_complete (ndirco2_t *ctx)
 Average Complete Check function.
 
void ndirco2_set_mode (ndirco2_t *ctx, uint8_t select_mode)
 Mode Set function.
 
void ndirco2_reset (ndirco2_t *ctx)
 Software Reset function.
 
uint8_t ndirco2_check_alarm (ndirco2_t *ctx)
 CO2 Concentration Limit Check function.
 

Detailed Description

This file contains API for NDIR CO2 Click driver.