Go to the documentation of this file.
38 #include "drv_digital_in.h"
39 #include "drv_i2c_master.h"
52 #define THERMO17_MAP_MIKROBUS( cfg, mikrobus ) \
53 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
54 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
55 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
56 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
63 #define THERMO17_SLAVE_ADDRESS 0x4C
70 #define THERMO17_REG_R_LOCAL_TEMP_HB 0x00
71 #define THERMO17_REG_R_REMOTE_TEMP_HB 0x01
72 #define THERMO17_REG_R_STATUS 0x02
73 #define THERMO17_REG_R_CFG 0x03
74 #define THERMO17_REG_R_CONVERSION_RATE 0x04
75 #define THERMO17_REG_R_LOCAL_TEMP_LIMIT_H 0x05
76 #define THERMO17_REG_R_LOCAL_TEMP_LIMIT_L 0x06
77 #define THERMO17_REG_R_REMOTE_TEMP_LIMIT_H_HB 0x07
78 #define THERMO17_REG_R_REMOTE_TEMP_LIMIT_L_HB 0x08
79 #define THERMO17_REG_R_REMOTE_TEMP_LB 0x10
80 #define THERMO17_REG_RW_REMOTE_TEMP_OFFSET_HB 0x11
81 #define THERMO17_REG_RW_REMOTE_TEMP_OFFSET_LB 0x12
82 #define THERMO17_REG_RW_REMOTE_TEMP_LIMIT_H_LB 0x13
83 #define THERMO17_REG_RW_REMOTE_TEMP_LIMIT_L_LB 0x14
84 #define THERMO17_REG_R_LOCAL_TEMP_LB 0x15
85 #define THERMO17_REG_RW_REMOTE_TEMP_THERM_LIMIT 0x19
86 #define THERMO17_REG_RW_LOCAL_TEMP_THERM_LIMIT 0x20
87 #define THERMO17_REG_RW_THERMO_HYSTERESIS 0x21
88 #define THERMO17_REG_RW_CONSECUTIVE_ALERT 0x22
89 #define THERMO17_REG_RW_M_FACTOR_CORRECTION 0x23
90 #define THERMO17_REG_RW_DIGITAL_FILTER_CTRL 0x24
91 #define THERMO17_REG_R_ID 0xFE
92 #define THERMO17_REG_W_CFG 0x09
93 #define THERMO17_REG_W_CONVERSION_RATE 0x0A
94 #define THERMO17_REG_W_LOCAL_TEMP_LIMIT_H 0x0B
95 #define THERMO17_REG_W_LOCAL_TEMP_LIMIT_L 0x0C
96 #define THERMO17_REG_W_REMOTE_TEMP_LIMIT_H_HB 0x0D
97 #define THERMO17_REG_W_REMOTE_TEMP_LIMIT_L_HB 0x0E
98 #define THERMO17_REG_W_ONE_SHOT 0x0F
105 #define THERMO17_TEMPERATURE_LOCAL 0xAA
106 #define THERMO17_TEMPERATURE_REMOTE 0xBB
107 #define THERMO17_ERROR 0x00
114 #define THERMO17_DEV_ID 0x55
121 #define THERMO17_STATUS_BUSY 0x80
122 #define THERMO17_STATUS_LOCAL_HIGH_TEMP 0x40
123 #define THERMO17_STATUS_LOCAL_LOW_TEMP 0x20
124 #define THERMO17_STATUS_REMOTE_HIGH_TEMP 0x10
125 #define THERMO17_STATUS_REMOTE_LOW_TEMP 0x08
126 #define THERMO17_STATUS_REMOTE_SENS_OPEN_CIRCUIT 0x04
127 #define THERMO17_STATUS_REMOTE_THERM_TIPPED 0x02
128 #define THERMO17_STATUS_LOCAL_THERM_TIPPED 0x01
135 #define THERMO17_RETVAL uint8_t
137 #define THERMO17_OK 0x00
138 #define THERMO17_INIT_ERROR 0xFF
285 #endif // _THERMO17_H_
digital_in_t int_pin
Definition: thermo17.h:158
pin_name_t sda
Definition: thermo17.h:178
uint8_t slave_address
Definition: thermo17.h:166
uint8_t thermo17_get_an_status(thermo17_t *ctx)
Checks status of an pin.
float thermo17_read_temp(thermo17_t *ctx, uint8_t temp_macro)
Function for reading temperature.
pin_name_t scl
Definition: thermo17.h:177
Click ctx object definition.
Definition: thermo17.h:153
digital_in_t an
Definition: thermo17.h:157
#define THERMO17_RETVAL
Definition: thermo17.h:135
pin_name_t int_pin
Definition: thermo17.h:183
THERMO17_RETVAL thermo17_init(thermo17_t *ctx, thermo17_cfg_t *cfg)
Initialization function.
uint32_t i2c_speed
Definition: thermo17.h:187
pin_name_t an
Definition: thermo17.h:182
Click configuration structure definition.
Definition: thermo17.h:173
i2c_master_t i2c
Definition: thermo17.h:162
uint8_t thermo17_generic_read(thermo17_t *ctx, uint8_t reg_adr)
Generic read function.
uint8_t i2c_address
Definition: thermo17.h:188
void thermo17_cfg_setup(thermo17_cfg_t *cfg)
Config Object Initialization function.
void thermo17_generic_write(thermo17_t *ctx, uint8_t reg_adr, uint8_t write_data)
Generic write function.
uint8_t thermo17_get_int_status(thermo17_t *ctx)
Checks status of int pin.