Go to the documentation of this file.
38 #include "mikrosdk_version.h"
41 #if mikroSDK_GET_VERSION < 20800ul
42 #include "rcu_delays.h"
48 #include "drv_digital_in.h"
49 #include "drv_i2c_master.h"
61 #define THERMO15_MAP_MIKROBUS( cfg, mikrobus ) \
62 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
63 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
64 cfg.alt = MIKROBUS( mikrobus, MIKROBUS_INT );
71 #define THERMO15_RETVAL uint8_t
73 #define THERMO15_OK 0x00
74 #define THERMO15_INIT_ERROR 0xFF
81 #define THERMO15_DEVICE_SLAVE_ADDR_000 0x48
82 #define THERMO15_DEVICE_SLAVE_ADDR_001 0x49
83 #define THERMO15_DEVICE_SLAVE_ADDR_010 0x4A
84 #define THERMO15_DEVICE_SLAVE_ADDR_011 0x4B
85 #define THERMO15_DEVICE_SLAVE_ADDR_100 0x4C
86 #define THERMO15_DEVICE_SLAVE_ADDR_101 0x4D
87 #define THERMO15_DEVICE_SLAVE_ADDR_110 0x4E
88 #define THERMO15_DEVICE_SLAVE_ADDR_111 0x4F
95 #define THERMO15_REG_STORED_TEMPERATURE 0x00
96 #define THERMO15_REG_CONFIGURATION 0x01
97 #define THERMO15_REG_TEMPERATURE_HYSTERESIS 0x02
98 #define THERMO15_REG_TEMPERATURE_LIMIT 0x03
99 #define THERMO15_REG_ONE_SHOT 0x04
106 #define THERMO15_DEF_TEMP_HYSTERESIS 75
107 #define THERMO15_DEF_TEMP_LIMIT 80
108 #define THERMO15_REG_ONE_SHOT 0x04
115 #define THERMO15_CFG_WMODE_NORMAL 0x00
116 #define THERMO15_CFG_WMODE_ONE_SHOT 0x20
117 #define THERMO15_CFG_WMODE_SHUTDOWN 0x01
118 #define THERMO15_CFG_FAULT_QUEUE_1 0x00
119 #define THERMO15_CFG_FAULT_QUEUE_2 0x08
120 #define THERMO15_CFG_FAULT_QUEUE_4 0x10
121 #define THERMO15_CFG_FAULT_QUEUE_6 0x18
122 #define THERMO15_CFG_ALERT_ACTIVE_LOW 0x00
123 #define THERMO15_CFG_ALERT_ACTIVE_HIGH 0x04
124 #define THERMO15_CFG_TMODE_COMPARATOR 0x00
125 #define THERMO15_CFG_TMODE_INTERRUPT 0x02
132 #define THERMO15_TEMP_IN_CELSIUS 0x00
133 #define THERMO15_TEMP_IN_KELVIN 0x01
134 #define THERMO15_TEMP_IN_FAHRENHEIT 0x02
293 #endif // _THERMO15_H_
pin_name_t sda
Definition: thermo15.h:169
uint32_t i2c_speed
Definition: thermo15.h:177
Click ctx object definition.
Definition: thermo15.h:148
pin_name_t scl
Definition: thermo15.h:168
pin_name_t alt
Definition: thermo15.h:173
uint8_t thermo15_get_interrupt_state(thermo15_t *ctx)
Interrupt state.
float thermo15_get_temperature_data(thermo15_t *ctx, uint8_t temp_format)
Ambient temperature data.
uint8_t i2c_address
Definition: thermo15.h:178
THERMO15_RETVAL thermo15_init(thermo15_t *ctx, thermo15_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition: thermo15.h:165
float thermo15_get_temp_register(thermo15_t *ctx, uint8_t temp_reg)
Get temperature register.
uint8_t slave_address
Definition: thermo15.h:157
void thermo15_generic_read(thermo15_t *ctx, uint8_t reg, uint8_t *data_buffer, uint8_t len)
Generic read function.
#define THERMO15_RETVAL
Definition: thermo15.h:71
void thermo15_cfg_setup(thermo15_cfg_t *cfg)
Config Object Initialization function.
void thermo15_set_temp_register(thermo15_t *ctx, uint8_t temp_reg, float temp_data)
Set temperature register.
digital_in_t alt
Definition: thermo15.h:149
i2c_master_t i2c
Definition: thermo15.h:153
void thermo15_generic_write(thermo15_t *ctx, uint8_t reg, uint8_t *data_buffer, uint8_t len)
Generic write function.
void thermo15_default_cfg(thermo15_t *ctx)
Click Default Configuration function.