Go to the documentation of this file.
42 #ifdef PREINIT_SUPPORTED
46 #ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52 #include "drv_digital_in.h"
53 #include "drv_i2c_master.h"
65 #define IRSENSE3_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
67 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
68 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT );
75 #define IRSENSE3_RETVAL uint8_t
77 #define IRSENSE3_OK 0x00
78 #define IRSENSE3_INIT_ERROR 0xFF
85 #define IRSENSE3_REG_COMPANY_CODE 0x00
86 #define IRSENSE3_REG_DEVICE_ID 0x01
87 #define IRSENSE3_REG_INFO_1 0x02
88 #define IRSENSE3_REG_INFO_2 0x03
89 #define IRSENSE3_REG_STATUS_1 0x04
90 #define IRSENSE3_REG_IR_LSB 0x05
91 #define IRSENSE3_REG_IR_MSB 0x06
92 #define IRSENSE3_REG_TEMP_LSB 0x07
93 #define IRSENSE3_REG_TEMP_MSB 0x08
94 #define IRSENSE3_REG_STATUS_2 0x09
95 #define IRSENSE3_REG_STATUS_3 0x0A
96 #define IRSENSE3_REG_STATUS_4 0x1F
97 #define IRSENSE3_REG_CTRL_1 0x20
98 #define IRSENSE3_REG_CTRL_2 0x21
99 #define IRSENSE3_REG_CTRL_3 0x22
100 #define IRSENSE3_REG_CTRL_4 0x23
101 #define IRSENSE3_REG_CTRL_5 0x24
102 #define IRSENSE3_REG_CTRL_6 0x25
103 #define IRSENSE3_REG_CTRL_7 0x26
104 #define IRSENSE3_REG_CTRL_8 0x27
105 #define IRSENSE3_REG_CTRL_9 0x28
106 #define IRSENSE3_REG_CTRL_10 0x29
107 #define IRSENSE3_REG_CTRL_11 0x2A
108 #define IRSENSE3_REG_CTRL_12 0x2B
115 #define IRSENSE3_DEVICE_ID 0x15
116 #define IRSENSE3_COMPANY_CODE 0x48
123 #define IRSENSE3_CTRL1_NORMAL_STATE 0xFE
124 #define IRSENSE3_CTRL1_SOFTWARE_RESET 0xFF
131 #define IRSENSE3_CTRL2_NO_SYNC 0xFC
132 #define IRSENSE3_CTRL2_MASTER_SYNC 0xFD
133 #define IRSENSE3_CTRL2_SLAVE_SYNC 0xFE
140 #define IRSENSE3_CTRL3_LOW_NOISE_DISABLE 0x80
141 #define IRSENSE3_CTRL3_LOW_NOISE_ENABLE 0xC0
142 #define IRSENSE3_CTRL3_ODR_1Hz 0x80
143 #define IRSENSE3_CTRL3_ODR_2Hz 0x90
144 #define IRSENSE3_CTRL3_ODR_10Hz 0xA0
145 #define IRSENSE3_CTRL3_ODR_50Hz 0xB0
146 #define IRSENSE3_CTRL3_NO_TEMP_FILTER 0x80
147 #define IRSENSE3_CTRL3_TEMP_FILTER_0p9Hz 0x84
148 #define IRSENSE3_CTRL3_TEMP_FILTER_0p445Hz 0x88
149 #define IRSENSE3_CTRL3_NO_IR_FILTER 0x80
150 #define IRSENSE3_CTRL3_IR_FILTER_0p9Hz 0x81
151 #define IRSENSE3_CTRL3_IR_FILTER_0p445Hz 0x82
158 #define IRSENSE3_CTRL4_TOPT_THR_DISABLE 0xF8
159 #define IRSENSE3_CTRL4_TOPT_THR_ENABLE 0xFC
160 #define IRSENSE3_CTRL4_TOPT_NOISE_DISABLE 0xF8
161 #define IRSENSE3_CTRL4_TOPT_NOISE_ENABLE 0xFB
168 #define IRSENSE3_CTRL7_HUMAN_DETECT_NORMAL 0xF0
169 #define IRSENSE3_CTRL7_HUMAN_DETECT_INVERT 0xF8
170 #define IRSENSE3_CTRL7_HUMAN_DETECT_TIME_0sec 0xF0
171 #define IRSENSE3_CTRL7_HUMAN_DETECT_TIME_5sec 0xF1
172 #define IRSENSE3_CTRL7_HUMAN_DETECT_TIME_10sec 0xF2
173 #define IRSENSE3_CTRL7_HUMAN_DETECT_TIME_30sec 0xF3
174 #define IRSENSE3_CTRL7_HUMAN_DETECT_TIME_300sec 0xF4
181 #define IRSENSE3_CTRL11_HBDEN_OFF 0xE0
182 #define IRSENSE3_CTRL11_HBDEN_ON 0xF0
183 #define IRSENSE3_CTRL11_DO_NOT_STOP_UPDATING_SB 0xE0
184 #define IRSENSE3_CTRL11_STOP_UPDATING_SB 0xE8
185 #define IRSENSE3_CTRL11_STREAMING_BUFFER_OFF 0xE0
186 #define IRSENSE3_CTRL11_STREAMING_BUFFER_ON 0xE4
187 #define IRSENSE3_CTRL11_INT_HUMAN_DISABLE 0xE0
188 #define IRSENSE3_CTRL11_INT_HUMAN_ENABLE 0xE2
189 #define IRSENSE3_CTRL11_INT_DRDY_DISABLE 0xE0
190 #define IRSENSE3_CTRL11_INT_DRDY_ENABLE 0xE1
197 #define IRSENSE3_CTRL12_STANDBY_MODE 0xFE
198 #define IRSENSE3_CTRL12_CONTINUOUS_MODE 0xFF
205 #define IRSENSE3_PRESENCE_IS_DETECTED 0x01
206 #define IRSENSE3_PRESENCE_IS_NOT_DETECTED 0x00
394 #endif // _IRSENSE3_H_
void irsense3_default_cfg(irsense3_t *ctx)
Click Default Configuration function.
i2c_master_t i2c
Definition: irsense3.h:227
pin_name_t int_pin
Definition: irsense3.h:247
uint8_t irsense3_get_interrupt_state(irsense3_t *ctx)
Get Interrupt state.
void irsense3_generic_read(irsense3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
Click ctx object definition.
Definition: irsense3.h:220
void irsense3_cfg_setup(irsense3_cfg_t *cfg)
Config Object Initialization function.
digital_in_t int_pin
Definition: irsense3.h:223
pin_name_t scl
Definition: irsense3.h:242
void irsense3_generic_write(irsense3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
IRSENSE3_RETVAL irsense3_init(irsense3_t *ctx, irsense3_cfg_t *cfg)
Initialization function.
uint8_t irsense3_human_approach_detect(irsense3_t *ctx)
Human approach detection.
void irsense3_software_reset(irsense3_t *ctx)
Software reset.
uint32_t i2c_speed
Definition: irsense3.h:251
float irsense3_get_temperature_data(irsense3_t *ctx)
Temperature data.
uint8_t slave_address
Definition: irsense3.h:231
pin_name_t sda
Definition: irsense3.h:243
float irsense3_get_ir_sensor_data(irsense3_t *ctx)
Output current of IR sensor.
Click configuration structure definition.
Definition: irsense3.h:239
#define IRSENSE3_RETVAL
Definition: irsense3.h:75
uint8_t i2c_address
Definition: irsense3.h:252