surfacetemp2 2.0.0.0
surfacetemp2.h File Reference

This file contains API for Surface temp 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  surfacetemp2_t
 Click ctx object definition. More...
 
struct  surfacetemp2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define SURFACETEMP2_MAP_MIKROBUS(cfg, mikrobus)
 
#define SURFACETEMP2_RETVAL   uint8_t
 
#define SURFACETEMP2_OK   0x00
 
#define SURFACETEMP2_INIT_ERROR   0xFF
 
#define SURFACETEMP2_I2C_DEV_ADR_0_0   0x48
 
#define SURFACETEMP2_I2C_DEV_ADR_0_1   0x49
 
#define SURFACETEMP2_I2C_DEV_ADR_1_0   0x4A
 
#define SURFACETEMP2_I2C_DEV_ADR_1_1   0x4B
 
#define SURFACETEMP2_REG_TEMP_MSB   0x00
 
#define SURFACETEMP2_REG_TEMP_LSB   0x01
 
#define SURFACETEMP2_REG_STAT   0x02
 
#define SURFACETEMP2_REG_CFG   0x03
 
#define SURFACETEMP2_REG_T_HIGH_SETP_MSB   0x04
 
#define SURFACETEMP2_REG_T_HIGH_SETP_LSB   0x05
 
#define SURFACETEMP2_REG_T_LOW_SETP_MSB   0x06
 
#define SURFACETEMP2_REG_T_LOW_SETP_LSB   0x07
 
#define SURFACETEMP2_REG_T_CRIT_SETP_MSB   0x08
 
#define SURFACETEMP2_REG_T_CRIT_SETP_LSB   0x09
 
#define SURFACETEMP2_REG_T_HYST_SETP   0x0A
 
#define SURFACETEMP2_REG_ID   0x0B
 
#define SURFACETEMP2_REG_SOFT_RESET   0x2F
 
#define SURFACETEMP2_STAT_T_LOW_MSK   0x10
 
#define SURFACETEMP2_STAT_T_HIGH_MSK   0x20
 
#define SURFACETEMP2_STAT_T_CRIT_MSK   0x40
 
#define SURFACETEMP2_STAT_RDY_MSK   0x80
 
#define SURFACETEMP2_CFG_FLT_Q_1   0x00
 
#define SURFACETEMP2_CFG_FLT_Q_2   0x01
 
#define SURFACETEMP2_CFG_FLT_Q_3   0x02
 
#define SURFACETEMP2_CFG_FLT_Q_4   0x03
 
#define SURFACETEMP2_CFG_CT_POL_ACT_H   0x04
 
#define SURFACETEMP2_CFG_CT_POL_ACT_L   0x00
 
#define SURFACETEMP2_CFG_INT_POL_ACT_H   0x08
 
#define SURFACETEMP2_CFG_INT_POL_ACT_L   0x00
 
#define SURFACETEMP2_CFG_INT_MODE   0x00
 
#define SURFACETEMP2_CFG_CT_MODE   0x10
 
#define SURFACETEMP2_CFG_OP_MODE_CONT   0x00
 
#define SURFACETEMP2_CFG_OP_MODE_ONE_SHT   0x20
 
#define SURFACETEMP2_CFG_OP_MODE_SPS   0x40
 
#define SURFACETEMP2_CFG_OP_MODE_SHDN   0x60
 
#define SURFACETEMP2_CFG_RES_13   0x00
 
#define SURFACETEMP2_CFG_RES_16   0x80
 
#define SURFACETEMP2_RES_13_BIT   0.0625
 
#define SURFACETEMP2_RES_16_BIT   0.0078125
 
#define SURFACETEMP2_DEV_ID_VAL   0xCB
 
#define SURFACETEMP2_DEV_OK   0x00
 
#define SURFACETEMP2_DEV_NOK   0x01
 

Functions

void surfacetemp2_cfg_setup (surfacetemp2_cfg_t *cfg)
 Config Object Initialization function.
 
SURFACETEMP2_RETVAL surfacetemp2_init (surfacetemp2_t *ctx, surfacetemp2_cfg_t *cfg)
 Initialization function.
 
void surfacetemp2_generic_write (surfacetemp2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void surfacetemp2_generic_read (surfacetemp2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void surfacetemp2_soft_reset (surfacetemp2_t *ctx)
 Software Reset function.
 
uint8_t surfacetemp2_setup (surfacetemp2_t *ctx, uint8_t setup)
 Setup function.
 
void surfacetemp2_set_hys_val (surfacetemp2_t *ctx, uint8_t hys_val)
 Set Hysteresis function.
 
float surfacetemp2_get_temperature (surfacetemp2_t *ctx)
 Get Temperature function.
 
void surfacetemp2_set_high_trsh (surfacetemp2_t *ctx, float trsh)
 Set Over Temperature Threshold function.
 
void surfacetemp2_set_low_trsh (surfacetemp2_t *ctx, float trsh)
 Set Under Temperature Threshold function.
 
void surfacetemp2_set_crit_trsh (surfacetemp2_t *ctx, float trsh)
 Set Critical Temperature Threshold function.
 
uint8_t surfacetemp2_get_int_pin (surfacetemp2_t *ctx)
 Get INT pin state function.
 
uint8_t surfacetemp2_get_ct_pin (surfacetemp2_t *ctx)
 Get CT pin state function.
 

Detailed Description

This file contains API for Surface temp 2 Click driver.