environment2  2.0.0.0
Data Structures | Macros | Enumerations | Functions
environment2.h File Reference

This file contains API for Environment 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  environment2_t
 Environment 2 Click context object. More...
 
struct  environment2_cfg_t
 Environment 2 Click configuration object. More...
 

Macros

#define ENVIRONMENT2_SGP40_CMD_MEASURE_RAW   0x260F
 Environment 2 SGP40 description commands. More...
 
#define ENVIRONMENT2_SGP40_CMD_MEASURE_TEST   0x280E
 
#define ENVIRONMENT2_SGP40_CMD_HEATER_OFF   0x3615
 
#define ENVIRONMENT2_SGP40_CMD_SOFT_RESET   0x0006
 
#define ENVIRONMENT2_SHT40_CMD_MEASURE_T_RH_HIGH_PRECISION   0xFD
 Environment 2 SHT40 description commands. More...
 
#define ENVIRONMENT2_SHT40_CMD_MEASURE_T_RH_MEDIUM_PRECISION   0xF6
 
#define ENVIRONMENT2_SHT40_CMD_MEASURE_T_RH_LOWEST_PRECISION   0xE0
 
#define ENVIRONMENT2_SHT40_CMD_READ_SERIAL   0x89
 
#define ENVIRONMENT2_SHT40_CMD_SOFT_RESET   0x94
 
#define ENVIRONMENT2_SHT40_CMD_ACTIVATE_HIGHEST_HEATER_1SEC   0x39
 
#define ENVIRONMENT2_SHT40_CMD_ACTIVATE_HIGHEST_HEATER_0_1SEC   0x32
 
#define ENVIRONMENT2_SHT40_CMD_ACTIVATE_MEDIUM_HEATER_1SEC   0x2F
 
#define ENVIRONMENT2_SHT40_CMD_ACTIVATE_MEDIUM_HEATER_0_1SEC   0x24
 
#define ENVIRONMENT2_SHT40_CMD_ACTIVATE_LOWEST_HEATER_1SEC   0x1E
 
#define ENVIRONMENT2_SHT40_CMD_ACTIVATE_LOWEST_HEATER_0_1SEC   0x15
 
#define ENVIRONMENT2_SGP40_SET_DEV_ADDR   0x59
 Environment 2 device address setting. More...
 
#define ENVIRONMENT2_SHT40_SET_DEV_ADDR   0x44
 
#define ENVIRONMENT2_SEL_SGP40   0x00
 Environment 2 device selection. More...
 
#define ENVIRONMENT2_SEL_SHT40   0x01
 
#define ENVIRONMENT2_SGP40_TEST_PASSED   0xD400
 Environment 2 SGP40 description setting. More...
 
#define ENVIRONMENT2_SGP40_TEST_FAILED   0x4B00
 
#define ENVIRONMENT2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping. More...
 

Enumerations

enum  environment2_return_value_t { ENVIRONMENT2_OK = 0, ENVIRONMENT2_ERROR = -1 }
 Environment 2 Click return value data. More...
 

Functions

void environment2_cfg_setup (environment2_cfg_t *cfg)
 Environment 2 configuration object setup function. More...
 
err_t environment2_init (environment2_t *ctx, environment2_cfg_t *cfg)
 Environment 2 initialization function. More...
 
err_t environment2_generic_write (environment2_t *ctx, uint8_t select_device, uint16_t cmd, uint8_t *tx_buf)
 Environment 2 I2C writing function. More...
 
err_t environment2_generic_read (environment2_t *ctx, uint8_t select_device, uint16_t cmd, uint8_t *rx_buf)
 Environment 2 I2C reading function. More...
 
err_t environment2_get_temp_hum (environment2_t *ctx, float *humidity, float *temperature)
 Environment 2 get temperature and relative humidity function. More...
 
err_t environment2_get_air_quality (environment2_t *ctx, uint16_t *air_quality)
 Environment 2 get air quality data function. More...
 
uint16_t environment2_sgp40_measure_test (environment2_t *ctx)
 Environment 2 SGP40 measurement test function. More...
 
err_t environment2_sgp40_heater_off (environment2_t *ctx)
 Environment 2 heater off function. More...
 
err_t environment2_sgp40_soft_reset (environment2_t *ctx)
 Environment 2 soft reset function. More...
 

Detailed Description

This file contains API for Environment 2 Click Driver.

Enumeration Type Documentation

◆ environment2_return_value_t

Environment 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
ENVIRONMENT2_OK 
ENVIRONMENT2_ERROR