temphum4 2.0.0.0
temphum4.h File Reference

This file contains API for Temp&Hum 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  temphum4_t
 Click ctx object definition. More...
 
struct  temphum4_cfg_t
 Click configuration structure definition. More...
 

Macros

#define TEMPHUM4_MAP_MIKROBUS(cfg, mikrobus)
 
#define TEMPHUM4_RETVAL   uint8_t
 
#define TEMPHUM4_OK   0x00
 
#define TEMPHUM4_INIT_ERROR   0xFF
 
#define TEMPHUM4_MODE_ACTIVE   0x01
 
#define TEMPHUM4_MODE_SLEEP   0x00
 
#define TEMPHUM4_REG_TEMPERATURE   0x00
 
#define TEMPHUM4_REG_HUMINIDY   0x01
 
#define TEMPHUM4_REG_CONFIGURATION   0x02
 
#define TEMPHUM4_REG_MANUFACTURER_ID   0xFE
 
#define TEMPHUM4_REG_DEVICE_ID   0xFF
 
#define TEMPHUM4_REG_SERIAL_ID   0xFB
 
#define TEMPHUM4_CONF_NORMAL_OPERATION   ( 0x00 << 14 )
 
#define TEMPHUM4_CONF_SOFT_RESET   ( 0x01 << 14 )
 
#define TEMPHUM4_CONF_HEATER_DISABLED   ( 0x00 << 12 )
 
#define TEMPHUM4_CONF_HEATER_ENABLED   ( 0x01 << 12 )
 
#define TEMPHUM4_CONF_MODE_TEMP_OR_HUM   ( 0x00 << 11 )
 
#define TEMPHUM4_CONF_MODE_TEMP_AND_HUM   ( 0x01 << 11 )
 
#define TEMPHUM4_CONF_BATTERY_VOLTAGE_2_8_V   ( 0x00 << 10 )
 
#define TEMPHUM4_CONF_TEMPERATURE_14bit   ( 0x00 << 9 )
 
#define TEMPHUM4_CONF_TEMPERATURE_11bit   ( 0x01 << 9 )
 
#define TEMPHUM4_CONF_HUMINIDY_14bit   ( 0x00 << 7 )
 
#define TEMPHUM4_CONF_HUMINIDY_11bit   ( 0x01 << 7 )
 
#define TEMPHUM4_CONF_HUMINIDY_9bit   ( 0x02 << 7 )
 
#define TEMPHUM4_MANUFACTURER_ID   0x5449
 

Functions

void temphum4_cfg_setup (temphum4_cfg_t *cfg)
 Config Object Initialization function.
 
TEMPHUM4_RETVAL temphum4_init (temphum4_t *ctx, temphum4_cfg_t *cfg)
 Initialization function.
 
void temphum4_default_cfg (temphum4_t *ctx)
 Click Default Configuration function.
 
void temphum4_generic_write (temphum4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void temphum4_generic_read (temphum4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void temphum4_set_mode (temphum4_t *ctx, uint8_t value)
 Set device mode function.
 
uint16_t temphum4_get_manifacturer_id (temphum4_t *ctx)
 Get manufacturer's id.
 
uint16_t temphum4_get_device_id (temphum4_t *ctx)
 Get device id.
 
void temphum4_configuration (temphum4_t *ctx, uint16_t conf_data)
 Set device configuration function.
 
float temphum4_get_temperature (temphum4_t *ctx)
 Get temperature function.
 
float temphum4_get_humidity (temphum4_t *ctx)
 Get humidity function.
 

Detailed Description

This file contains API for Temp&Hum 4 Click driver.