irsense4  2.1.0.0
irsense4.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2020 MikroElektronika d.o.o.
3 ** Contact: https://www.mikroe.com/contact
4 **
5 ** Permission is hereby granted, free of charge, to any person obtaining a copy
6 ** of this software and associated documentation files (the "Software"), to deal
7 ** in the Software without restriction, including without limitation the rights
8 ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 ** copies of the Software, and to permit persons to whom the Software is
10 ** furnished to do so, subject to the following conditions:
11 ** The above copyright notice and this permission notice shall be
12 ** included in all copies or substantial portions of the Software.
13 **
14 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16 ** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19 ** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 ** USE OR OTHER DEALINGS IN THE SOFTWARE.
21 ****************************************************************************/
22 
28 #ifndef IRSENSE4_H
29 #define IRSENSE4_H
30 
31 #ifdef __cplusplus
32 extern "C"{
33 #endif
34 
35 #include "mikrosdk_version.h"
36 
37 #ifdef __GNUC__
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
40 #else
41 #include "delays.h"
42 #endif
43 #endif
44 
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_i2c_master.h"
48 #include "drv_spi_master.h"
49 #include "spi_specifics.h"
50 
72 #define IRSENSE4_REG_LPF1 0x0C
73 #define IRSENSE4_REG_LPF2 0x0D
74 #define IRSENSE4_REG_WHO_AM_I 0x0F
75 #define IRSENSE4_REG_AVG_TRIM 0x10
76 #define IRSENSE4_REG_CTRL0 0x17
77 #define IRSENSE4_REG_SENS_DATA 0x1D
78 #define IRSENSE4_REG_CTRL1 0x20
79 #define IRSENSE4_REG_CTRL2 0x21
80 #define IRSENSE4_REG_CTRL3 0x22
81 #define IRSENSE4_REG_STATUS 0x23
82 #define IRSENSE4_REG_FUNC_STATUS 0x25
83 #define IRSENSE4_REG_TOBJECT_L 0x26
84 #define IRSENSE4_REG_TOBJECT_H 0x27
85 #define IRSENSE4_REG_TAMBIENT_L 0x28
86 #define IRSENSE4_REG_TAMBIENT_H 0x29
87 #define IRSENSE4_REG_TOBJ_COMP_L 0x38
88 #define IRSENSE4_REG_TOBJ_COMP_H 0x39
89 #define IRSENSE4_REG_TPRESENCE_L 0x3A
90 #define IRSENSE4_REG_TPRESENCE_H 0x3B
91 #define IRSENSE4_REG_TMOTION_L 0x3C
92 #define IRSENSE4_REG_TMOTION_H 0x3D
93 #define IRSENSE4_REG_TAMB_SHOCK_L 0x3E
94 #define IRSENSE4_REG_TAMB_SHOCK_H 0x3F
95 
100 #define IRSENSE4_REG_EMB_FUNC_CFG_ADDR 0x08
101 #define IRSENSE4_REG_EMB_FUNC_CFG_DATA 0x09
102 #define IRSENSE4_REG_EMB_PAGE_RW 0x11
103 #define IRSENSE4_REG_EMB_PRESENCE_THS_L 0x20
104 #define IRSENSE4_REG_EMB_PRESENCE_THS_H 0x21
105 #define IRSENSE4_REG_EMB_MOTION_THS_L 0x22
106 #define IRSENSE4_REG_EMB_MOTION_THS_H 0x23
107 #define IRSENSE4_REG_EMB_TAMB_SHOCK_THS_L 0x24
108 #define IRSENSE4_REG_EMB_TAMB_SHOCK_THS_H 0x25
109 #define IRSENSE4_REG_EMB_HYST_MOTION 0x26
110 #define IRSENSE4_REG_EMB_HYST_PRESENCE 0x27
111 #define IRSENSE4_REG_EMB_ALGO_CONFIG 0x28
112 #define IRSENSE4_REG_EMB_HYST_TAMB_SHOCK 0x29
113 #define IRSENSE4_REG_EMB_RESET_ALGO 0x2A
114  // irsense4_reg
116 
132 #define IRSENSE4_LPF1_M_ODR_9 0x00
133 #define IRSENSE4_LPF1_M_ODR_20 0x01
134 #define IRSENSE4_LPF1_M_ODR_50 0x02
135 #define IRSENSE4_LPF1_M_ODR_100 0x03
136 #define IRSENSE4_LPF1_M_ODR_200 0x04
137 #define IRSENSE4_LPF1_M_ODR_400 0x05
138 #define IRSENSE4_LPF1_M_ODR_800 0x06
139 #define IRSENSE4_LPF1_M_BIT_MASK 0x07
140 #define IRSENSE4_LPF1_P_M_ODR_9 0x00
141 #define IRSENSE4_LPF1_P_M_ODR_20 0x08
142 #define IRSENSE4_LPF1_P_M_ODR_50 0x10
143 #define IRSENSE4_LPF1_P_M_ODR_100 0x18
144 #define IRSENSE4_LPF1_P_M_ODR_200 0x20
145 #define IRSENSE4_LPF1_P_M_ODR_400 0x28
146 #define IRSENSE4_LPF1_P_M_ODR_800 0x30
147 
154 #define IRSENSE4_LPF2_A_T_ODR_9 0x00
155 #define IRSENSE4_LPF2_A_T_ODR_20 0x01
156 #define IRSENSE4_LPF2_A_T_ODR_50 0x02
157 #define IRSENSE4_LPF2_A_T_ODR_100 0x03
158 #define IRSENSE4_LPF2_A_T_ODR_200 0x04
159 #define IRSENSE4_LPF2_A_T_ODR_400 0x05
160 #define IRSENSE4_LPF2_A_T_ODR_800 0x06
161 #define IRSENSE4_LPF2_A_T_BIT_MASK 0x07
162 #define IRSENSE4_LPF2_P_ODR_9 0x00
163 #define IRSENSE4_LPF2_P_ODR_20 0x08
164 #define IRSENSE4_LPF2_P_ODR_50 0x10
165 #define IRSENSE4_LPF2_P_ODR_100 0x18
166 #define IRSENSE4_LPF2_P_ODR_200 0x20
167 #define IRSENSE4_LPF2_P_ODR_400 0x28
168 #define IRSENSE4_LPF2_P_ODR_800 0x30
169 #define IRSENSE4_LPF2_P_BIT_MASK 0x38
170 
176 #define IRSENSE4_DEVICE_ID 0xD3
177 
184 #define IRSENSE4_AVG_TRIM_TMOS_2 0x00
185 #define IRSENSE4_AVG_TRIM_TMOS_8 0x01
186 #define IRSENSE4_AVG_TRIM_TMOS_32 0x02
187 #define IRSENSE4_AVG_TRIM_TMOS_128 0x03
188 #define IRSENSE4_AVG_TRIM_TMOS_256 0x04
189 #define IRSENSE4_AVG_TRIM_TMOS_512 0x05
190 #define IRSENSE4_AVG_TRIM_TMOS_1024 0x06
191 #define IRSENSE4_AVG_TRIM_TMOS_2048 0x07
192 #define IRSENSE4_AVG_TRIM_TMOS_BIT_MASK 0x07
193 #define IRSENSE4_AVG_TRIM_T_8 0x00
194 #define IRSENSE4_AVG_TRIM_T_4 0x10
195 #define IRSENSE4_AVG_TRIM_T_2 0x20
196 #define IRSENSE4_AVG_TRIM_T_1 0x30
197 #define IRSENSE4_AVG_TRIM_T_BIT_MASK 0x30
198 
203 #define IRSENSE4_CTRL0_GAIN_1 0x00
204 #define IRSENSE4_CTRL0_GAIN_2 0x10
205 #define IRSENSE4_CTRL0_GAIN_3 0x20
206 #define IRSENSE4_CTRL0_GAIN_4 0x30
207 #define IRSENSE4_CTRL0_GAIN_5 0x40
208 #define IRSENSE4_CTRL0_GAIN_6 0x50
209 #define IRSENSE4_CTRL0_GAIN_7 0x60
210 #define IRSENSE4_CTRL0_GAIN_8 0x70
211 #define IRSENSE4_CTRL0_DEFAULT 0x81
212 
218 #define IRSENSE4_SENS_DATA_CALC_DEV 16u
219 #define IRSENSE4_SENS_DATA_MIN 2048u
220 #define IRSENSE4_SENS_DATA_MAX 6128u
221 
227 #define IRSENSE4_CTRL1_ODR_POWER_DOWN 0x00
228 #define IRSENSE4_CTRL1_ODR_0_25 0x01
229 #define IRSENSE4_CTRL1_ODR_0_5 0x02
230 #define IRSENSE4_CTRL1_ODR_1 0x03
231 #define IRSENSE4_CTRL1_ODR_2 0x04
232 #define IRSENSE4_CTRL1_ODR_4 0x05
233 #define IRSENSE4_CTRL1_ODR_8 0x06
234 #define IRSENSE4_CTRL1_ODR_15 0x07
235 #define IRSENSE4_CTRL1_ODR_30 0x08
236 #define IRSENSE4_CTRL1_ODR_BIT_MASK 0x0F
237 #define IRSENSE4_CTRL1_BDU_DIS 0x00
238 #define IRSENSE4_CTRL1_BDU_EN 0x01
239 
244 #define IRSENSE4_CTRL2_ONE_SHOT_DIS 0x00
245 #define IRSENSE4_CTRL2_ONE_SHOT_EN 0x01
246 #define IRSENSE4_CTRL2_F_CFG_ACCESS_DIS 0x00
247 #define IRSENSE4_CTRL2_F_CFG_ACCESS_EN 0x10
248 
253 #define IRSENSE4_CTRL3_IEN_HIGH_Z 0x00
254 #define IRSENSE4_CTRL3_IEN_DRDY 0x01
255 #define IRSENSE4_CTRL3_IEN_INT_OR 0x02
256 #define IRSENSE4_CTRL3_IEN_BIT_MASK 0x03
257 #define IRSENSE4_CTRL3_INT_LATCHED_PLS 0x00
258 #define IRSENSE4_CTRL3_INT_LATCHED_LAT 0x04
259 #define IRSENSE4_CTRL3_INT_MSK_T_SHOCK 0x08
260 #define IRSENSE4_CTRL3_INT_MSK_MOT 0x10
261 #define IRSENSE4_CTRL3_INT_MSK_PRES 0x20
262 #define IRSENSE4_CTRL3_PP_OD_PUSH_PULL 0x00
263 #define IRSENSE4_CTRL3_PP_OD_OPEN_DRAIN 0x04
264 #define IRSENSE4_CTRL3_INT_H_L_HIGH 0x00
265 #define IRSENSE4_CTRL3_INT_H_L_LOW 0x80
266 #define IRSENSE4_CTRL3_BIT_MASK 0x38
267 
272 #define IRSENSE4_STATUS_TAMB_SHOCK_FLAG 0x01
273 #define IRSENSE4_STATUS_MOT_FLAG 0x02
274 #define IRSENSE4_STATUS_PRES_FLAG 0x04
275 #define IRSENSE4_STATUS_DETECT_FLAG 0x07
276 #define IRSENSE4_STATUS_NOT_DRDY 0x00
277 #define IRSENSE4_STATUS_DRDY 0x04
278 
284 #define IRSENSE4_SET_THS_PRESENCE_DEFAULT 5000u
285 #define IRSENSE4_SET_THS_MOTION_DEFAULT 3000u
286 #define IRSENSE4_SET_THS_T_SHOCK_DEFAULT 2000u
287 #define IRSENSE4_SET_THS_MAX 0x7FFFu
288 
294 #define IRSENSE4_SENS_TOBJECT 2000.0f
295 #define IRSENSE4_SENS_TAMBIENT 100.0f
296 #define IRSENSE4_SENS_TOBJ_COMP 2000.0f
297 
303 #define IRSENSE4_EMB_PAGE_RW_READ_DIS 0x00
304 #define IRSENSE4_EMB_PAGE_RW_READ_EN 0x20
305 #define IRSENSE4_EMB_PAGE_RW_WRITE_DIS 0x00
306 #define IRSENSE4_EMB_PAGE_RW_WRITE_EN 0x40
307 
313 #define IRSENSE4_DEVICE_ADDRESS 0x5A
314 
323 #define IRSENSE4_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
324 #define IRSENSE4_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
325  // irsense4_set
327 
342 #define IRSENSE4_MAP_MIKROBUS( cfg, mikrobus ) \
343  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
344  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
345  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
346  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
347  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
348  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
349  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
350  // irsense4_map // irsense4
353 
358 typedef enum
359 {
364 
369 typedef err_t ( *irsense4_master_io_t )( struct irsense4_s*, uint8_t, uint8_t*, uint8_t );
375 typedef struct irsense4_s
376 {
377  digital_in_t int_pin;
379  i2c_master_t i2c;
380  spi_master_t spi;
382  uint8_t slave_address;
383  pin_name_t chip_select;
390 
395 typedef struct
396 {
397  pin_name_t scl;
398  pin_name_t sda;
399  pin_name_t miso;
400  pin_name_t mosi;
401  pin_name_t sck;
402  pin_name_t cs;
403  pin_name_t int_pin;
405  uint32_t i2c_speed;
406  uint8_t i2c_address;
408  uint32_t spi_speed;
409  spi_master_mode_t spi_mode;
410  spi_master_chip_select_polarity_t cs_polarity;
415 
420 typedef enum
421 {
423  IRSENSE4_ERROR = -1
424 
426 
431 typedef enum
432 {
438 
455 
471 
486 
500 
515 err_t irsense4_generic_write ( irsense4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len );
516 
531 err_t irsense4_generic_read ( irsense4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len );
532 
547 err_t irsense4_write_reg ( irsense4_t *ctx, uint8_t reg, uint8_t data_in );
548 
563 err_t irsense4_read_reg ( irsense4_t *ctx, uint8_t reg, uint8_t *data_out );
564 
579 err_t irsense4_read_word ( irsense4_t *ctx, uint8_t reg, int16_t *data_out );
580 
594 err_t irsense4_set_lp_filter_motion ( irsense4_t *ctx, uint8_t lpf_m );
595 
609 err_t irsense4_set_lp_filter_presence ( irsense4_t *ctx, uint8_t lpf_p );
610 
624 err_t irsense4_set_lp_filter_amb_temp ( irsense4_t *ctx, uint8_t lpf_at );
625 
639 err_t irsense4_get_device_id ( irsense4_t *ctx, uint8_t *device_id );
640 
655 err_t irsense4_set_avr_temp ( irsense4_t *ctx, uint8_t avr_amp_temp, uint8_t avr_obj_temp );
656 
670 err_t irsense4_set_gain_mode ( irsense4_t *ctx, uint8_t gain_mode );
671 
686 err_t irsense4_set_sens_data ( irsense4_t *ctx, uint16_t sens );
687 
701 err_t irsense4_config_odr ( irsense4_t *ctx, uint8_t odr );
702 
716 
730 err_t irsense4_set_int_mask ( irsense4_t *ctx, uint8_t int_mask );
731 
745 err_t irsense4_config_int_signal ( irsense4_t *ctx, uint8_t int_sr );
746 
760 
775 err_t irsense4_get_status ( irsense4_t *ctx, uint8_t *status );
776 
790 err_t irsense4_get_obj_temperature ( irsense4_t *ctx, float *temperature );
791 
805 err_t irsense4_get_amb_temperature ( irsense4_t *ctx, float *temperature );
806 
820 err_t irsense4_get_comp_temperature ( irsense4_t *ctx, float *temperature );
821 
835 err_t irsense4_get_presence_data ( irsense4_t *ctx, int16_t *presence );
836 
850 err_t irsense4_get_motion_data ( irsense4_t *ctx, int16_t *motion );
851 
865 err_t irsense4_get_amb_shock_data ( irsense4_t *ctx, int16_t *shock );
866 
881 err_t irsense4_write_emb_reg ( irsense4_t *ctx, uint8_t reg_emb, uint8_t data_in );
882 
897 err_t irsense4_read_emb_reg ( irsense4_t *ctx, uint8_t reg_emb, uint8_t *data_out );
898 
914 err_t irsense4_set_threshold ( irsense4_t *ctx, irsense4_ths_sel_t ths_sel, uint16_t threshold );
915 
931 err_t irsense4_get_threshold ( irsense4_t *ctx, irsense4_ths_sel_t ths_sel, uint16_t *threshold );
932 
933 #ifdef __cplusplus
934 }
935 #endif
936 #endif // IRSENSE4_H
937  // irsense4
939 
940 // ------------------------------------------------------------------------ END
IRSENSE4_THS_TAMB_SHOCK
@ IRSENSE4_THS_TAMB_SHOCK
Definition: irsense4.h:435
irsense4_set_lp_filter_presence
err_t irsense4_set_lp_filter_presence(irsense4_t *ctx, uint8_t lpf_p)
IR Sense 4 set low-pass filter for presence function.
irsense4_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: irsense4.h:410
irsense4_cfg_t::i2c_address
uint8_t i2c_address
Definition: irsense4.h:406
irsense4_set_sens_data
err_t irsense4_set_sens_data(irsense4_t *ctx, uint16_t sens)
IR Sense 4 set sensitivity data function.
irsense4_get_presence_data
err_t irsense4_get_presence_data(irsense4_t *ctx, int16_t *presence)
IR Sense 4 get the presence detection data function.
irsense4_cfg_t::sda
pin_name_t sda
Definition: irsense4.h:398
irsense4_init
err_t irsense4_init(irsense4_t *ctx, irsense4_cfg_t *cfg)
IR Sense 4 initialization function.
IRSENSE4_OK
@ IRSENSE4_OK
Definition: irsense4.h:422
irsense4_config_odr
err_t irsense4_config_odr(irsense4_t *ctx, uint8_t odr)
IR Sense 4 set output data rate function.
irsense4_cfg_t::scl
pin_name_t scl
Definition: irsense4.h:397
irsense4_drv_t
irsense4_drv_t
IR Sense 4 Click driver selector.
Definition: irsense4.h:359
irsense4_set_avr_temp
err_t irsense4_set_avr_temp(irsense4_t *ctx, uint8_t avr_amp_temp, uint8_t avr_obj_temp)
IR Sense 4 set averages for temperature function.
irsense4_generic_write
err_t irsense4_generic_write(irsense4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
IR Sense 4 data writing function.
irsense4_s
IR Sense 4 Click context object.
Definition: irsense4.h:376
spi_specifics.h
This file contains SPI specific macros, functions, etc.
irsense4_s::drv_sel
irsense4_drv_t drv_sel
Definition: irsense4.h:384
irsense4_read_emb_reg
err_t irsense4_read_emb_reg(irsense4_t *ctx, uint8_t reg_emb, uint8_t *data_out)
IR Sense 4 write register function.
irsense4_s::read_f
irsense4_master_io_t read_f
Definition: irsense4.h:387
irsense4_wait_new_data_ready
err_t irsense4_wait_new_data_ready(irsense4_t *ctx)
IR Sense 4 wait new data ready function.
irsense4_cfg_t
IR Sense 4 Click configuration object.
Definition: irsense4.h:396
irsense4_get_amb_temperature
err_t irsense4_get_amb_temperature(irsense4_t *ctx, float *temperature)
IR Sense 4 get the ambient temperature function.
irsense4_get_motion_data
err_t irsense4_get_motion_data(irsense4_t *ctx, int16_t *motion)
IR Sense 4 get the motion detection data function.
irsense4_default_cfg
err_t irsense4_default_cfg(irsense4_t *ctx)
IR Sense 4 default configuration function.
IRSENSE4_ERROR
@ IRSENSE4_ERROR
Definition: irsense4.h:423
irsense4_cfg_t::drv_sel
irsense4_drv_t drv_sel
Definition: irsense4.h:412
IRSENSE4_DRV_SEL_SPI
@ IRSENSE4_DRV_SEL_SPI
Definition: irsense4.h:360
irsense4_write_reg
err_t irsense4_write_reg(irsense4_t *ctx, uint8_t reg, uint8_t data_in)
IR Sense 4 write register function.
irsense4_get_obj_temperature
err_t irsense4_get_obj_temperature(irsense4_t *ctx, float *temperature)
IR Sense 4 get the object temperature function.
irsense4_set_int_mask
err_t irsense4_set_int_mask(irsense4_t *ctx, uint8_t int_mask)
IR Sense 4 set interrupt masks for flag function.
irsense4_get_threshold
err_t irsense4_get_threshold(irsense4_t *ctx, irsense4_ths_sel_t ths_sel, uint16_t *threshold)
IR Sense 4 get the threshold data function.
irsense4_s::chip_select
pin_name_t chip_select
Definition: irsense4.h:383
irsense4_cfg_t::sck
pin_name_t sck
Definition: irsense4.h:401
irsense4_cfg_setup
void irsense4_cfg_setup(irsense4_cfg_t *cfg)
IR Sense 4 configuration object setup function.
irsense4_set_gain_mode
err_t irsense4_set_gain_mode(irsense4_t *ctx, uint8_t gain_mode)
IR Sense 4 set gain mode function.
irsense4_cfg_t::int_pin
pin_name_t int_pin
Definition: irsense4.h:403
irsense4_s::spi
spi_master_t spi
Definition: irsense4.h:380
irsense4_s::write_f
irsense4_master_io_t write_f
Definition: irsense4.h:386
irsense4_get_amb_shock_data
err_t irsense4_get_amb_shock_data(irsense4_t *ctx, int16_t *shock)
IR Sense 4 get the ambient shock detection data function.
irsense4_get_comp_temperature
err_t irsense4_get_comp_temperature(irsense4_t *ctx, float *temperature)
IR Sense 4 get the compensated temperature function.
irsense4_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: irsense4.h:409
irsense4_s::i2c
i2c_master_t i2c
Definition: irsense4.h:379
irsense4_generic_read
err_t irsense4_generic_read(irsense4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
IR Sense 4 data reading function.
irsense4_cfg_t::miso
pin_name_t miso
Definition: irsense4.h:399
irsense4_read_word
err_t irsense4_read_word(irsense4_t *ctx, uint8_t reg, int16_t *data_out)
IR Sense 4 read word function.
irsense4_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: irsense4.h:405
irsense4_cfg_t::spi_speed
uint32_t spi_speed
Definition: irsense4.h:408
irsense4_set_lp_filter_motion
err_t irsense4_set_lp_filter_motion(irsense4_t *ctx, uint8_t lpf_m)
IR Sense 4 set low-pass filter for motion function.
irsense4_get_status
err_t irsense4_get_status(irsense4_t *ctx, uint8_t *status)
IR Sense 4 get status function.
irsense4_enable_one_shot
err_t irsense4_enable_one_shot(irsense4_t *ctx)
IR Sense 4 enable one-shot mode function.
irsense4_ths_sel_t
irsense4_ths_sel_t
IR Sense 4 Click threshold selection data value for detection algorithm.
Definition: irsense4.h:432
irsense4_master_io_t
err_t(* irsense4_master_io_t)(struct irsense4_s *, uint8_t, uint8_t *, uint8_t)
IR Sense 4 Click driver interface.
Definition: irsense4.h:369
irsense4_s::int_pin
digital_in_t int_pin
Definition: irsense4.h:377
irsense4_s::slave_address
uint8_t slave_address
Definition: irsense4.h:382
irsense4_set_lp_filter_amb_temp
err_t irsense4_set_lp_filter_amb_temp(irsense4_t *ctx, uint8_t lpf_at)
IR Sense 4 set low-pass filter for ambient temperature function.
IRSENSE4_THS_PRESENCE
@ IRSENSE4_THS_PRESENCE
Definition: irsense4.h:433
irsense4_return_value_t
irsense4_return_value_t
IR Sense 4 Click return value data.
Definition: irsense4.h:421
irsense4_get_device_id
err_t irsense4_get_device_id(irsense4_t *ctx, uint8_t *device_id)
IR Sense 4 get device ID function.
irsense4_read_reg
err_t irsense4_read_reg(irsense4_t *ctx, uint8_t reg, uint8_t *data_out)
IR Sense 4 read register function.
irsense4_drv_interface_selection
void irsense4_drv_interface_selection(irsense4_cfg_t *cfg, irsense4_drv_t drv_sel)
IR Sense 4 driver interface setup function.
IRSENSE4_DRV_SEL_I2C
@ IRSENSE4_DRV_SEL_I2C
Definition: irsense4.h:361
irsense4_t
struct irsense4_s irsense4_t
IR Sense 4 Click context object.
irsense4_cfg_t::mosi
pin_name_t mosi
Definition: irsense4.h:400
irsense4_cfg_t::cs
pin_name_t cs
Definition: irsense4.h:402
irsense4_set_threshold
err_t irsense4_set_threshold(irsense4_t *ctx, irsense4_ths_sel_t ths_sel, uint16_t threshold)
IR Sense 4 set threshold data function.
irsense4_write_emb_reg
err_t irsense4_write_emb_reg(irsense4_t *ctx, uint8_t reg_emb, uint8_t data_in)
IR Sense 4 write the embedded register function.
IRSENSE4_THS_MOTION
@ IRSENSE4_THS_MOTION
Definition: irsense4.h:434
irsense4_config_int_signal
err_t irsense4_config_int_signal(irsense4_t *ctx, uint8_t int_sr)
IR Sense 4 configur interrupt the signal function.