environment4 2.1.0.0
environment4.h File Reference

This file contains API for Environment 4 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  environment4_t
 Environment 4 Click context object. More...
 
struct  environment4_cfg_t
 Environment 4 Click configuration object. More...
 

Macros

#define ENVIRONMENT4_SGP_CMD_EXE_CONDITIONING   0x2612u
 Environment 4 SGP41 commands list.
 
#define ENVIRONMENT4_SGP_CMD_MEAS_RAW_SIGNALS   0x2619u
 
#define ENVIRONMENT4_SGP_CMD_EXE_SELF_TEST   0x280Eu
 
#define ENVIRONMENT4_SGP_TURN_HEATER_OFF   0x3615u
 
#define ENVIRONMENT4_SGP_GET_SERIAL_NUMBER   0x3682u
 
#define ENVIRONMENT4_SHT_CMD_MEAS_TH_HIGH_PREC   0xFD
 Environment 4 SHT41A commands list.
 
#define ENVIRONMENT4_SHT_CMD_MEAS_TH_MED_PREC   0xF6
 
#define ENVIRONMENT4_SHT_CMD_MEAS_TH_LOW_PREC   0xE0
 
#define ENVIRONMENT4_SHT_CMD_READ_SERIAL_NUM   0x89
 
#define ENVIRONMENT4_SHT_CMD_SOFT_RESET   0x94
 
#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_200mW_1S   0x39
 
#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_200mW_0p1S   0x32
 
#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_110mW_1S   0x2F
 
#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_110mW_0p1S   0x24
 
#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_20mW_1S   0x1E
 
#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_20mW_0p1S   0x15
 
#define ENVIRONMENT4_SGP_SELF_TEST_OK   0x00
 Environment 4 SGP41 self test bit values.
 
#define ENVIRONMENT4_SGP_SELF_TEST_VOC_PIXEL   0x01
 
#define ENVIRONMENT4_SGP_SELF_TEST_NOX_PIXEL   0x02
 
#define ENVIRONMENT4_SGP_SELF_TEST_MASK   0x03
 
#define ENVIRONMENT4_SHT_MAX_RH   100.0
 Environment 4 SHT41A temperature and humidity calculation values.
 
#define ENVIRONMENT4_SHT_MIN_RH   0.0
 
#define ENVIRONMENT4_SHT_DATA_RESOLUTION   65535.0
 
#define ENVIRONMENT4_SHT_ABS_MIN_TEMP   ( -45.0 )
 
#define ENVIRONMENT4_SHT_ABS_MAX_TEMP   ( 130.0 )
 
#define ENVIRONMENT4_SHT_ABS_MIN_HUM   ( -6.0 )
 
#define ENVIRONMENT4_SHT_ABS_MAX_HUM   ( 119.0 )
 
#define ENVIRONMENT4_SHT_DEVICE_ADDRESS   0x44
 Environment 4 device address setting.
 
#define ENVIRONMENT4_SGP_DEVICE_ADDRESS   0x59
 
#define ENVIRONMENT4_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  environment4_return_value_t { ENVIRONMENT4_OK = 0 , ENVIRONMENT4_ERROR = -1 }
 Environment 4 Click return value data. More...
 

Functions

void environment4_cfg_setup (environment4_cfg_t *cfg)
 Environment 4 configuration object setup function.
 
err_t environment4_init (environment4_t *ctx, environment4_cfg_t *cfg)
 Environment 4 initialization function.
 
err_t environment4_sgp_exe_conditioning (environment4_t *ctx, uint16_t comp_rh, uint16_t comp_t, uint16_t *sraw_voc)
 Environment 4 sgp exe conditioning function.
 
err_t environment4_sgp_meas_raw_signals (environment4_t *ctx, uint16_t comp_rh, uint16_t comp_t, uint16_t *sraw_voc, uint16_t *sraw_nox)
 Environment 4 sgp meas raw signals function.
 
err_t environment4_sgp_exe_self_test (environment4_t *ctx, uint8_t *test_result)
 Environment 4 sgp exe self test function.
 
err_t environment4_sgp_turn_heater_off (environment4_t *ctx)
 Environment 4 sgp turn heater off function.
 
err_t environment4_sgp_get_serial_num (environment4_t *ctx, uint16_t *serial_num)
 Environment 4 sgp get serial num function.
 
err_t environment4_sht_send_cmd (environment4_t *ctx, uint8_t cmd)
 Environment 4 sht send cmd function.
 
err_t environment4_sht_read_response (environment4_t *ctx, uint8_t *data_out)
 Environment 4 sht read response function.
 
err_t environment4_sht_soft_reset (environment4_t *ctx)
 Environment 4 sht soft reset function.
 
err_t environment4_sht_read_serial_num (environment4_t *ctx, uint32_t *serial_num)
 Environment 4 sht read serial num function.
 
err_t environment4_sht_read_meas_hp (environment4_t *ctx, float *temp, float *hum)
 Environment 4 sht read meas hp function.
 

Detailed Description

This file contains API for Environment 4 Click Driver.

Enumeration Type Documentation

◆ environment4_return_value_t

Environment 4 Click return value data.

Predefined enum values for driver return values.

Enumerator
ENVIRONMENT4_OK 
ENVIRONMENT4_ERROR