Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_i2c_master.h"
69 #define IRTHERMO4_REG_TP_OBJECT 0x01
70 #define IRTHERMO4_REG_TP_AMBIENT 0x03
71 #define IRTHERMO4_REG_TP_OBJ_LP1 0x05
72 #define IRTHERMO4_REG_TP_OBJ_LP2 0x07
73 #define IRTHERMO4_REG_TP_AMB_LP3 0x0A
74 #define IRTHERMO4_REG_TP_OBJ_LP2_FROZEN 0x0C
75 #define IRTHERMO4_REG_TP_PRESENCE 0x0F
76 #define IRTHERMO4_REG_TP_MOTION 0x10
77 #define IRTHERMO4_REG_TP_AMB_SHOCK 0x11
78 #define IRTHERMO4_REG_INTERRUPT_STATUS 0x12
79 #define IRTHERMO4_REG_CHIP_STATUS 0x13
80 #define IRTHERMO4_REG_S_LP1_LP2 0x14
81 #define IRTHERMO4_REG_S_LP3 0x15
82 #define IRTHERMO4_REG_TP_PRESENCE_THOLD 0x16
83 #define IRTHERMO4_REG_TP_MOTION_THOLD 0x17
84 #define IRTHERMO4_REG_TP_AMB_SHOCK_THOLD 0x18
85 #define IRTHERMO4_REG_INTERRUPT_MASK 0x19
86 #define IRTHERMO4_REG_MULTIPLE 0x1A
87 #define IRTHERMO4_REG_TIMER_INTERRUPT 0x1B
88 #define IRTHERMO4_REG_TP_OT_THOLD 0x1C
89 #define IRTHERMO4_REG_EEPROM_CONTROL 0x1F
90 #define IRTHERMO4_REG_EEPROM_CONTENT 0x20
91 #define IRTHERMO4_REG_SLAVE_ADDRESS 0x3F
109 #define IRTHERMO4_ROOM_TEMPERATURE 25.0f
110 #define IRTHERMO4_FUNCTION_EXPONENT 4.2f
111 #define IRTHERMO4_DIGITS_K_TO_M 100.0f
112 #define IRTHERMO4_TP_OFFSET_TO_U0 32768
113 #define IRTHERMO4_TP_OUT_TO_UOUT 2
119 #define IRTHERMO4_EEPROM_READ_ENABLE 0x80
120 #define IRTHERMO4_EEPROM_READ_DISABLE 0x00
126 #define IRTHERMO4_CMD_RELOAD 0x04
133 #define IRTHERMO4_DEVICE_ADDRESS_GEN_CALL 0x00
134 #define IRTHERMO4_DEVICE_ADDRESS_GND 0x0C
135 #define IRTHERMO4_DEVICE_ADDRESS_VCC 0x0E
153 #define IRTHERMO4_MAP_MIKROBUS( cfg, mikrobus ) \
154 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
155 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
156 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
395 #endif // IRTHERMO4_H
err_t irthermo4_read_object_temp(irthermo4_t *ctx, float *t_obj, float t_amb)
IR Thermo 4 read object temp function.
uint32_t uout1
Definition: irthermo4.h:172
pin_name_t int_pin
Definition: irthermo4.h:207
pin_name_t sda
Definition: irthermo4.h:205
digital_in_t int_pin
Definition: irthermo4.h:186
err_t irthermo4_read_eeprom(irthermo4_t *ctx)
IR Thermo 4 read EEPROM function.
err_t irthermo4_read_regs(irthermo4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
IR Thermo 4 read regs function.
err_t irthermo4_init(irthermo4_t *ctx, irthermo4_cfg_t *cfg)
IR Thermo 4 initialization function.
float k_val
Definition: irthermo4.h:175
IR Thermo 4 Click configuration object.
Definition: irthermo4.h:203
uint8_t slave_address
Definition: irthermo4.h:192
uint8_t protocol
Definition: irthermo4.h:167
IR Thermo 4 Click EEPROM content object.
Definition: irthermo4.h:166
uint8_t slave_add
Definition: irthermo4.h:174
float m_val
Definition: irthermo4.h:170
uint8_t i2c_address
Definition: irthermo4.h:210
uint8_t irthermo4_get_int_pin(irthermo4_t *ctx)
IR Thermo 4 get int pin function.
IR Thermo 4 Click context object.
Definition: irthermo4.h:184
err_t irthermo4_write_regs(irthermo4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
IR Thermo 4 write regs function.
irthermo4_eeprom_t eeprom
Definition: irthermo4.h:194
pin_name_t scl
Definition: irthermo4.h:204
err_t irthermo4_refresh_address(irthermo4_t *ctx)
IR Thermo 4 refresh address function.
uint32_t i2c_speed
Definition: irthermo4.h:209
err_t irthermo4_read_ambient_temp(irthermo4_t *ctx, float *t_amb)
IR Thermo 4 read ambient temp function.
uint32_t u0_val
Definition: irthermo4.h:171
err_t irthermo4_write_reg(irthermo4_t *ctx, uint8_t reg, uint8_t data_in)
IR Thermo 4 write reg function.
void irthermo4_cfg_setup(irthermo4_cfg_t *cfg)
IR Thermo 4 configuration object setup function.
err_t irthermo4_read_reg(irthermo4_t *ctx, uint8_t reg, uint8_t *data_out)
IR Thermo 4 read reg function.
@ IRTHERMO4_ERROR
Definition: irthermo4.h:221
uint16_t ptat25
Definition: irthermo4.h:169
err_t irthermo4_default_cfg(irthermo4_t *ctx)
IR Thermo 4 default configuration function.
uint8_t lookup
Definition: irthermo4.h:168
irthermo4_return_value_t
IR Thermo 4 Click return value data.
Definition: irthermo4.h:219
@ IRTHERMO4_OK
Definition: irthermo4.h:220
uint8_t tobj1
Definition: irthermo4.h:173
i2c_master_t i2c
Definition: irthermo4.h:189