39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define THERMO22_REG_TEMPERATURE 0x00
74#define THERMO22_REG_CONFIGURATION 0x01
75#define THERMO22_REG_TEMPERATURE_LOW 0x02
76#define THERMO22_REG_TEMPERATURE_HIGH 0x03
77#define THERMO22_REG_ONE_SHOT 0x04
95#define THERMO22_CONFIG_ONESHOT_DIS 0x00
96#define THERMO22_CONFIG_ONESHOT_EN 0x20
97#define THERMO22_CONFIG_FAULT_QUEUE_1 0x00
98#define THERMO22_CONFIG_FAULT_QUEUE_2 0x08
99#define THERMO22_CONFIG_FAULT_QUEUE_4 0x10
100#define THERMO22_CONFIG_FAULT_QUEUE_6 0x18
101#define THERMO22_CONFIG_ALERT_ACTIVE_LOW 0x00
102#define THERMO22_CONFIG_ALERT_ACTIVE_HIGH 0x04
103#define THERMO22_CONFIG_ALERT_COMPARATOR 0x00
104#define THERMO22_CONFIG_ALERT_INTERRUPT 0x02
105#define THERMO22_CONFIG_SHUTDOWN_DIS 0x00
106#define THERMO22_CONFIG_SHUTDOWN_EN 0x01
112#define THERMO22_TEMPERATURE_RESOLUTION 0.0625
113#define THERMO22_TEMPERATURE_MAX 128.0
114#define THERMO22_TEMPERATURE_MIN -128.0
115#define THERMO22_TEMPERATURE_ALERT_LIMIT 35.0
122#define THERMO22_DEV_ADDR_A2A1A0_000 0x48
123#define THERMO22_DEV_ADDR_A2A1A0_001 0x49
124#define THERMO22_DEV_ADDR_A2A1A0_010 0x4A
125#define THERMO22_DEV_ADDR_A2A1A0_011 0x4B
126#define THERMO22_DEV_ADDR_A2A1A0_100 0x4C
127#define THERMO22_DEV_ADDR_A2A1A0_101 0x4D
128#define THERMO22_DEV_ADDR_A2A1A0_110 0x4E
129#define THERMO22_DEV_ADDR_A2A1A0_111 0x4F
147#define THERMO22_MAP_MIKROBUS( cfg, mikrobus ) \
148 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
149 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
150 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
err_t thermo22_set_temperature_low_limit(thermo22_t *ctx, float low_limit)
Thermo 22 set temperature low limit function.
err_t thermo22_init(thermo22_t *ctx, thermo22_cfg_t *cfg)
Thermo 22 initialization function.
err_t thermo22_read_config(thermo22_t *ctx, uint8_t *config)
Thermo 22 read config function.
err_t thermo22_set_temperature_high_limit(thermo22_t *ctx, float high_limit)
Thermo 22 set temperature high limit function.
uint8_t thermo22_get_int_pin(thermo22_t *ctx)
Thermo 22 get int pin function.
err_t thermo22_default_cfg(thermo22_t *ctx)
Thermo 22 default configuration function.
err_t thermo22_write_config(thermo22_t *ctx, uint8_t config)
Thermo 22 write config function.
err_t thermo22_read_temperature(thermo22_t *ctx, float *temperature)
Thermo 22 read temperature function.
void thermo22_cfg_setup(thermo22_cfg_t *cfg)
Thermo 22 configuration object setup function.
Thermo 22 Click configuration object.
Definition thermo22.h:177
uint32_t i2c_speed
Definition thermo22.h:183
pin_name_t scl
Definition thermo22.h:178
pin_name_t int_pin
Definition thermo22.h:181
pin_name_t sda
Definition thermo22.h:179
uint8_t i2c_address
Definition thermo22.h:184
Thermo 22 Click context object.
Definition thermo22.h:160
digital_in_t int_pin
Definition thermo22.h:162
i2c_master_t i2c
Definition thermo22.h:165
uint8_t slave_address
Definition thermo22.h:168
thermo22_return_value_t
Thermo 22 Click return value data.
Definition thermo22.h:193
@ THERMO22_OK
Definition thermo22.h:194
@ THERMO22_ERROR
Definition thermo22.h:195