temphum18 2.0.0.0
temphum18.h File Reference

This file contains API for Temp&Hum 18 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  temphum18_t
 Temp&Hum 18 Click context object. More...
 
struct  temphum18_cfg_t
 Temp&Hum 18 Click configuration object. More...
 

Macros

#define TEMPHUM18_REG_HUMIDITY_SENSOR_RESOLUTION_READ   0x06
 Temp&Hum 18 description register.
 
#define TEMPHUM18_REG_HUMIDITY_SENSOR_RESOLUTION_WRITE   0x46
 
#define TEMPHUM18_REG_TEMPERATURE_SENSOR_RESOLUTION_READ   0x11
 
#define TEMPHUM18_REG_TEMPERATURE_SENSOR_RESOLUTION_WRITE   0x51
 
#define TEMPHUM18_REG_SENSOR_ID_UPPER_READ   0x1E
 
#define TEMPHUM18_REG_SENSOR_ID_LOWER_READ   0x1F
 
#define TEMPHUM18_CMD_ENTER_PROGRAMMING_MODE   0xA0
 Temp&Hum 18 description command.
 
#define TEMPHUM18_CMD_DUMMY   0x00
 
#define TEMPHUM18_CMD_ENTER_MEASUREMENTS_MODE   0x80
 
#define TEMPHUM18_STATUS_VALID_DATA   0x00
 Temp&Hum 18 description status bits.
 
#define TEMPHUM18_STATUS_STALE_DATA   0x01
 
#define TEMPHUM18_RESOLUTION_8_BITS   0x00
 Temp&Hum 18 description setting.
 
#define TEMPHUM18_RESOLUTION_10_BITS   0x01
 
#define TEMPHUM18_RESOLUTION_12_BITS   0x02
 
#define TEMPHUM18_RESOLUTION_14_BITS   0x03
 
#define TEMPHUM18_SET_DEV_ADDR   0x44
 Temp&Hum 18 device address setting.
 
#define TEMPHUM18_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  temphum18_return_value_t { TEMPHUM18_OK = 0 , TEMPHUM18_ERROR = -1 }
 Temp&Hum 18 Click return value data. More...
 

Functions

void temphum18_cfg_setup (temphum18_cfg_t *cfg)
 Temp&Hum 18 configuration object setup function.
 
err_t temphum18_init (temphum18_t *ctx, temphum18_cfg_t *cfg)
 Temp&Hum 18 initialization function.
 
err_t temphum18_default_cfg (temphum18_t *ctx)
 Temp&Hum 18 default configuration function.
 
err_t temphum18_generic_write (temphum18_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Temp&Hum 18 I2C writing function.
 
err_t temphum18_generic_read (temphum18_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Temp&Hum 18 I2C reading function.
 
err_t temphum18_wake_up (temphum18_t *ctx)
 Temp&Hum 18 wake up function.
 
err_t temphum18_get_raw_data (temphum18_t *ctx, uint8_t resolution, int16_t *temp, uint16_t *hum, uint8_t *status)
 Temp&Hum 18 get raw data function.
 
err_t temphum18_get_temp_hum (temphum18_t *ctx, uint8_t resolution, float *temperature, float *humidity)
 Temp&Hum 18 get temperature and humidity function.
 
err_t temphum18_enter_programming_mode (temphum18_t *ctx)
 Temp&Hum 18 enter programming mode function.
 
err_t temphum18_enter_measurements_mode (temphum18_t *ctx)
 Temp&Hum 18 enter measurements mode function.
 
err_t temphum18_set_relative_humidity_resolution (temphum18_t *ctx, uint8_t resolution)
 Temp&Hum 18 set relative humidity resolution function.
 
err_t temphum18_set_temperature_resolution (temphum18_t *ctx, uint8_t resolution)
 Temp&Hum 18 set relative temperature resolution function.
 

Detailed Description

This file contains API for Temp&Hum 18 Click Driver.

Enumeration Type Documentation

◆ temphum18_return_value_t

Temp&Hum 18 Click return value data.

Predefined enum values for driver return values.

Enumerator
TEMPHUM18_OK 
TEMPHUM18_ERROR