42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
67#define THERMO14_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
69 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
70 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
77#define THERMO14_RETVAL uint8_t
79#define THERMO14_OK 0x00
80#define THERMO14_INIT_ERROR 0xFF
87#define THERMO14_I2C_ADR_VDD 0x38
88#define THERMO14_I2C_ADR_GND 0x3F
89#define THERMO14_ARA_ADR 0x0C
96#define THERMO14_WHOAMI 0x01
97#define THERMO14_TEMP_H_LIMIT 0x02
98#define THERMO14_TEMP_L_LIMIT 0x03
99#define THERMO14_CTL 0x04
100#define THERMO14_STAT 0x05
101#define THERMO14_TEMP_L_OUT 0x06
102#define THERMO14_TEMP_H_OUT 0x07
103#define THERMO14_SW_RST 0x0C
110#define THERMO14_CTL_LOW_ODR_ST 0x80
111#define THERMO14_CTL_BDU 0x40
112#define THERMO14_CTL_AVG_8 0x00
113#define THERMO14_CTL_AVG_4 0x10
114#define THERMO14_CTL_AVG_2 0x20
115#define THERMO14_CTL_AVG_1 0x30
116#define THERMO14_CTL_IF_ADR_INC 0x08
117#define THERMO14_CTL_FREERUN 0x04
118#define THERMO14_CTL_TIME_OUT_DIS 0x02
119#define THERMO14_CTL_ONE_SHOT 0x01
126#define THERMO14_SW_RST_RST_CMD 0x02
127#define THERMO14_SW_RST_LOW_ODR_EN 0x40
#define THERMO14_RETVAL
Definition thermo14.h:77
THERMO14_RETVAL thermo14_init(thermo14_t *ctx, thermo14_cfg_t *cfg)
Initialization function.
float thermo14_raw_to_celsius(thermo14_t *ctx, int16_t temp_raw)
Temperature Calculation function. ````````````````.
void thermo14_generic_read(thermo14_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
float thermo14_get_temperature(thermo14_t *ctx)
Get Temperature in Centigrade function.
void thermo14_default_cfg(thermo14_t *ctx)
void thermo14_cfg_setup(thermo14_cfg_t *cfg)
Config Object Initialization function.
int16_t thermo14_temp_raw_get(thermo14_t *ctx)
Get Raw Temperature Data function.
void thermo14_sensor_enable(thermo14_t *ctx)
Sensor enable function.
uint8_t thermo14_get_int(thermo14_t *ctx)
Get Interrupt state function.
void thermo14_generic_write(thermo14_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
void thermo14_reset(thermo14_t *ctx)
Reset function.
void thermo14_low_temp_trsh(thermo14_t *ctx, float trsh_val)
Set the low temperature threshold value function.
void thermo14_high_temp_trsh(thermo14_t *ctx, float trsh_val)
Set the high temperature threshold value function.
Click configuration structure definition.
Definition thermo14.h:161
uint32_t i2c_speed
Definition thermo14.h:174
pin_name_t scl
Definition thermo14.h:164
pin_name_t int_pin
Definition thermo14.h:170
pin_name_t sda
Definition thermo14.h:165
uint8_t i2c_address
Definition thermo14.h:175
Click ctx object definition.
Definition thermo14.h:141
digital_in_t int_pin
Definition thermo14.h:145
i2c_master_t i2c
Definition thermo14.h:149
uint8_t slave_address
Definition thermo14.h:153