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 "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
38 #include "drv_spi_master.h"
39 #include "spi_specifics.h"
40 
62 #define IRSENSE4_REG_LPF1 0x0C
63 #define IRSENSE4_REG_LPF2 0x0D
64 #define IRSENSE4_REG_WHO_AM_I 0x0F
65 #define IRSENSE4_REG_AVG_TRIM 0x10
66 #define IRSENSE4_REG_CTRL0 0x17
67 #define IRSENSE4_REG_SENS_DATA 0x1D
68 #define IRSENSE4_REG_CTRL1 0x20
69 #define IRSENSE4_REG_CTRL2 0x21
70 #define IRSENSE4_REG_CTRL3 0x22
71 #define IRSENSE4_REG_STATUS 0x23
72 #define IRSENSE4_REG_FUNC_STATUS 0x25
73 #define IRSENSE4_REG_TOBJECT_L 0x26
74 #define IRSENSE4_REG_TOBJECT_H 0x27
75 #define IRSENSE4_REG_TAMBIENT_L 0x28
76 #define IRSENSE4_REG_TAMBIENT_H 0x29
77 #define IRSENSE4_REG_TOBJ_COMP_L 0x38
78 #define IRSENSE4_REG_TOBJ_COMP_H 0x39
79 #define IRSENSE4_REG_TPRESENCE_L 0x3A
80 #define IRSENSE4_REG_TPRESENCE_H 0x3B
81 #define IRSENSE4_REG_TMOTION_L 0x3C
82 #define IRSENSE4_REG_TMOTION_H 0x3D
83 #define IRSENSE4_REG_TAMB_SHOCK_L 0x3E
84 #define IRSENSE4_REG_TAMB_SHOCK_H 0x3F
85 
90 #define IRSENSE4_REG_EMB_FUNC_CFG_ADDR 0x08
91 #define IRSENSE4_REG_EMB_FUNC_CFG_DATA 0x09
92 #define IRSENSE4_REG_EMB_PAGE_RW 0x11
93 #define IRSENSE4_REG_EMB_PRESENCE_THS_L 0x20
94 #define IRSENSE4_REG_EMB_PRESENCE_THS_H 0x21
95 #define IRSENSE4_REG_EMB_MOTION_THS_L 0x22
96 #define IRSENSE4_REG_EMB_MOTION_THS_H 0x23
97 #define IRSENSE4_REG_EMB_TAMB_SHOCK_THS_L 0x24
98 #define IRSENSE4_REG_EMB_TAMB_SHOCK_THS_H 0x25
99 #define IRSENSE4_REG_EMB_HYST_MOTION 0x26
100 #define IRSENSE4_REG_EMB_HYST_PRESENCE 0x27
101 #define IRSENSE4_REG_EMB_ALGO_CONFIG 0x28
102 #define IRSENSE4_REG_EMB_HYST_TAMB_SHOCK 0x29
103 #define IRSENSE4_REG_EMB_RESET_ALGO 0x2A
104  // irsense4_reg
106 
122 #define IRSENSE4_LPF1_M_ODR_9 0x00
123 #define IRSENSE4_LPF1_M_ODR_20 0x01
124 #define IRSENSE4_LPF1_M_ODR_50 0x02
125 #define IRSENSE4_LPF1_M_ODR_100 0x03
126 #define IRSENSE4_LPF1_M_ODR_200 0x04
127 #define IRSENSE4_LPF1_M_ODR_400 0x05
128 #define IRSENSE4_LPF1_M_ODR_800 0x06
129 #define IRSENSE4_LPF1_M_BIT_MASK 0x07
130 #define IRSENSE4_LPF1_P_M_ODR_9 0x00
131 #define IRSENSE4_LPF1_P_M_ODR_20 0x08
132 #define IRSENSE4_LPF1_P_M_ODR_50 0x10
133 #define IRSENSE4_LPF1_P_M_ODR_100 0x18
134 #define IRSENSE4_LPF1_P_M_ODR_200 0x20
135 #define IRSENSE4_LPF1_P_M_ODR_400 0x28
136 #define IRSENSE4_LPF1_P_M_ODR_800 0x30
137 
144 #define IRSENSE4_LPF2_A_T_ODR_9 0x00
145 #define IRSENSE4_LPF2_A_T_ODR_20 0x01
146 #define IRSENSE4_LPF2_A_T_ODR_50 0x02
147 #define IRSENSE4_LPF2_A_T_ODR_100 0x03
148 #define IRSENSE4_LPF2_A_T_ODR_200 0x04
149 #define IRSENSE4_LPF2_A_T_ODR_400 0x05
150 #define IRSENSE4_LPF2_A_T_ODR_800 0x06
151 #define IRSENSE4_LPF2_A_T_BIT_MASK 0x07
152 #define IRSENSE4_LPF2_P_ODR_9 0x00
153 #define IRSENSE4_LPF2_P_ODR_20 0x08
154 #define IRSENSE4_LPF2_P_ODR_50 0x10
155 #define IRSENSE4_LPF2_P_ODR_100 0x18
156 #define IRSENSE4_LPF2_P_ODR_200 0x20
157 #define IRSENSE4_LPF2_P_ODR_400 0x28
158 #define IRSENSE4_LPF2_P_ODR_800 0x30
159 #define IRSENSE4_LPF2_P_BIT_MASK 0x38
160 
166 #define IRSENSE4_DEVICE_ID 0xD3
167 
174 #define IRSENSE4_AVG_TRIM_TMOS_2 0x00
175 #define IRSENSE4_AVG_TRIM_TMOS_8 0x01
176 #define IRSENSE4_AVG_TRIM_TMOS_32 0x02
177 #define IRSENSE4_AVG_TRIM_TMOS_128 0x03
178 #define IRSENSE4_AVG_TRIM_TMOS_256 0x04
179 #define IRSENSE4_AVG_TRIM_TMOS_512 0x05
180 #define IRSENSE4_AVG_TRIM_TMOS_1024 0x06
181 #define IRSENSE4_AVG_TRIM_TMOS_2048 0x07
182 #define IRSENSE4_AVG_TRIM_TMOS_BIT_MASK 0x07
183 #define IRSENSE4_AVG_TRIM_T_8 0x00
184 #define IRSENSE4_AVG_TRIM_T_4 0x10
185 #define IRSENSE4_AVG_TRIM_T_2 0x20
186 #define IRSENSE4_AVG_TRIM_T_1 0x30
187 #define IRSENSE4_AVG_TRIM_T_BIT_MASK 0x30
188 
193 #define IRSENSE4_CTRL0_GAIN_1 0x00
194 #define IRSENSE4_CTRL0_GAIN_2 0x10
195 #define IRSENSE4_CTRL0_GAIN_3 0x20
196 #define IRSENSE4_CTRL0_GAIN_4 0x30
197 #define IRSENSE4_CTRL0_GAIN_5 0x40
198 #define IRSENSE4_CTRL0_GAIN_6 0x50
199 #define IRSENSE4_CTRL0_GAIN_7 0x60
200 #define IRSENSE4_CTRL0_GAIN_8 0x70
201 #define IRSENSE4_CTRL0_DEFAULT 0x81
202 
208 #define IRSENSE4_SENS_DATA_CALC_DEV 16u
209 #define IRSENSE4_SENS_DATA_MIN 2048u
210 #define IRSENSE4_SENS_DATA_MAX 6128u
211 
217 #define IRSENSE4_CTRL1_ODR_POWER_DOWN 0x00
218 #define IRSENSE4_CTRL1_ODR_0_25 0x01
219 #define IRSENSE4_CTRL1_ODR_0_5 0x02
220 #define IRSENSE4_CTRL1_ODR_1 0x03
221 #define IRSENSE4_CTRL1_ODR_2 0x04
222 #define IRSENSE4_CTRL1_ODR_4 0x05
223 #define IRSENSE4_CTRL1_ODR_8 0x06
224 #define IRSENSE4_CTRL1_ODR_15 0x07
225 #define IRSENSE4_CTRL1_ODR_30 0x08
226 #define IRSENSE4_CTRL1_ODR_BIT_MASK 0x0F
227 #define IRSENSE4_CTRL1_BDU_DIS 0x00
228 #define IRSENSE4_CTRL1_BDU_EN 0x01
229 
234 #define IRSENSE4_CTRL2_ONE_SHOT_DIS 0x00
235 #define IRSENSE4_CTRL2_ONE_SHOT_EN 0x01
236 #define IRSENSE4_CTRL2_F_CFG_ACCESS_DIS 0x00
237 #define IRSENSE4_CTRL2_F_CFG_ACCESS_EN 0x10
238 
243 #define IRSENSE4_CTRL3_IEN_HIGH_Z 0x00
244 #define IRSENSE4_CTRL3_IEN_DRDY 0x01
245 #define IRSENSE4_CTRL3_IEN_INT_OR 0x02
246 #define IRSENSE4_CTRL3_IEN_BIT_MASK 0x03
247 #define IRSENSE4_CTRL3_INT_LATCHED_PLS 0x00
248 #define IRSENSE4_CTRL3_INT_LATCHED_LAT 0x04
249 #define IRSENSE4_CTRL3_INT_MSK_T_SHOCK 0x08
250 #define IRSENSE4_CTRL3_INT_MSK_MOT 0x10
251 #define IRSENSE4_CTRL3_INT_MSK_PRES 0x20
252 #define IRSENSE4_CTRL3_PP_OD_PUSH_PULL 0x00
253 #define IRSENSE4_CTRL3_PP_OD_OPEN_DRAIN 0x04
254 #define IRSENSE4_CTRL3_INT_H_L_HIGH 0x00
255 #define IRSENSE4_CTRL3_INT_H_L_LOW 0x80
256 #define IRSENSE4_CTRL3_BIT_MASK 0x38
257 
262 #define IRSENSE4_STATUS_TAMB_SHOCK_FLAG 0x01
263 #define IRSENSE4_STATUS_MOT_FLAG 0x02
264 #define IRSENSE4_STATUS_PRES_FLAG 0x04
265 #define IRSENSE4_STATUS_DETECT_FLAG 0x07
266 #define IRSENSE4_STATUS_NOT_DRDY 0x00
267 #define IRSENSE4_STATUS_DRDY 0x04
268 
274 #define IRSENSE4_SET_THS_PRESENCE_DEFAULT 5000u
275 #define IRSENSE4_SET_THS_MOTION_DEFAULT 3000u
276 #define IRSENSE4_SET_THS_T_SHOCK_DEFAULT 2000u
277 #define IRSENSE4_SET_THS_MAX 0x7FFFu
278 
284 #define IRSENSE4_SENS_TOBJECT 2000.0f
285 #define IRSENSE4_SENS_TAMBIENT 100.0f
286 #define IRSENSE4_SENS_TOBJ_COMP 2000.0f
287 
293 #define IRSENSE4_EMB_PAGE_RW_READ_DIS 0x00
294 #define IRSENSE4_EMB_PAGE_RW_READ_EN 0x20
295 #define IRSENSE4_EMB_PAGE_RW_WRITE_DIS 0x00
296 #define IRSENSE4_EMB_PAGE_RW_WRITE_EN 0x40
297 
303 #define IRSENSE4_DEVICE_ADDRESS 0x5A
304 
313 #define IRSENSE4_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
314 #define IRSENSE4_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
315  // irsense4_set
317 
332 #define IRSENSE4_MAP_MIKROBUS( cfg, mikrobus ) \
333  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
334  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
335  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
336  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
337  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
338  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
339  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
340  // irsense4_map // irsense4
343 
348 typedef enum
349 {
354 
359 typedef err_t ( *irsense4_master_io_t )( struct irsense4_s*, uint8_t, uint8_t*, uint8_t );
365 typedef struct irsense4_s
366 {
367  digital_in_t int_pin;
369  i2c_master_t i2c;
370  spi_master_t spi;
372  uint8_t slave_address;
373  pin_name_t chip_select;
380 
385 typedef struct
386 {
387  pin_name_t scl;
388  pin_name_t sda;
389  pin_name_t miso;
390  pin_name_t mosi;
391  pin_name_t sck;
392  pin_name_t cs;
393  pin_name_t int_pin;
395  uint32_t i2c_speed;
396  uint8_t i2c_address;
398  uint32_t spi_speed;
399  spi_master_mode_t spi_mode;
400  spi_master_chip_select_polarity_t cs_polarity;
405 
410 typedef enum
411 {
413  IRSENSE4_ERROR = -1
414 
416 
421 typedef enum
422 {
428 
445 
461 
476 
490 
505 err_t irsense4_generic_write ( irsense4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len );
506 
521 err_t irsense4_generic_read ( irsense4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len );
522 
537 err_t irsense4_write_reg ( irsense4_t *ctx, uint8_t reg, uint8_t data_in );
538 
553 err_t irsense4_read_reg ( irsense4_t *ctx, uint8_t reg, uint8_t *data_out );
554 
569 err_t irsense4_read_word ( irsense4_t *ctx, uint8_t reg, int16_t *data_out );
570 
584 err_t irsense4_set_lp_filter_motion ( irsense4_t *ctx, uint8_t lpf_m );
585 
599 err_t irsense4_set_lp_filter_presence ( irsense4_t *ctx, uint8_t lpf_p );
600 
614 err_t irsense4_set_lp_filter_amb_temp ( irsense4_t *ctx, uint8_t lpf_at );
615 
629 err_t irsense4_get_device_id ( irsense4_t *ctx, uint8_t *device_id );
630 
645 err_t irsense4_set_avr_temp ( irsense4_t *ctx, uint8_t avr_amp_temp, uint8_t avr_obj_temp );
646 
660 err_t irsense4_set_gain_mode ( irsense4_t *ctx, uint8_t gain_mode );
661 
676 err_t irsense4_set_sens_data ( irsense4_t *ctx, uint16_t sens );
677 
691 err_t irsense4_config_odr ( irsense4_t *ctx, uint8_t odr );
692 
706 
720 err_t irsense4_set_int_mask ( irsense4_t *ctx, uint8_t int_mask );
721 
735 err_t irsense4_config_int_signal ( irsense4_t *ctx, uint8_t int_sr );
736 
750 
765 err_t irsense4_get_status ( irsense4_t *ctx, uint8_t *status );
766 
780 err_t irsense4_get_obj_temperature ( irsense4_t *ctx, float *temperature );
781 
795 err_t irsense4_get_amb_temperature ( irsense4_t *ctx, float *temperature );
796 
810 err_t irsense4_get_comp_temperature ( irsense4_t *ctx, float *temperature );
811 
825 err_t irsense4_get_presence_data ( irsense4_t *ctx, int16_t *presence );
826 
840 err_t irsense4_get_motion_data ( irsense4_t *ctx, int16_t *motion );
841 
855 err_t irsense4_get_amb_shock_data ( irsense4_t *ctx, int16_t *shock );
856 
871 err_t irsense4_write_emb_reg ( irsense4_t *ctx, uint8_t reg_emb, uint8_t data_in );
872 
887 err_t irsense4_read_emb_reg ( irsense4_t *ctx, uint8_t reg_emb, uint8_t *data_out );
888 
904 err_t irsense4_set_threshold ( irsense4_t *ctx, irsense4_ths_sel_t ths_sel, uint16_t threshold );
905 
921 err_t irsense4_get_threshold ( irsense4_t *ctx, irsense4_ths_sel_t ths_sel, uint16_t *threshold );
922 
923 #ifdef __cplusplus
924 }
925 #endif
926 #endif // IRSENSE4_H
927  // irsense4
929 
930 // ------------------------------------------------------------------------ END
IRSENSE4_THS_TAMB_SHOCK
@ IRSENSE4_THS_TAMB_SHOCK
Definition: irsense4.h:425
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:400
irsense4_cfg_t::i2c_address
uint8_t i2c_address
Definition: irsense4.h:396
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:388
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:412
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:387
irsense4_drv_t
irsense4_drv_t
IR Sense 4 Click driver selector.
Definition: irsense4.h:349
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:366
spi_specifics.h
This file contains SPI specific macros, functions, etc.
irsense4_s::drv_sel
irsense4_drv_t drv_sel
Definition: irsense4.h:374
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:377
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:386
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:413
irsense4_cfg_t::drv_sel
irsense4_drv_t drv_sel
Definition: irsense4.h:402
IRSENSE4_DRV_SEL_SPI
@ IRSENSE4_DRV_SEL_SPI
Definition: irsense4.h:350
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:373
irsense4_cfg_t::sck
pin_name_t sck
Definition: irsense4.h:391
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:393
irsense4_s::spi
spi_master_t spi
Definition: irsense4.h:370
irsense4_s::write_f
irsense4_master_io_t write_f
Definition: irsense4.h:376
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:399
irsense4_s::i2c
i2c_master_t i2c
Definition: irsense4.h:369
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:389
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:395
irsense4_cfg_t::spi_speed
uint32_t spi_speed
Definition: irsense4.h:398
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:422
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:359
irsense4_s::int_pin
digital_in_t int_pin
Definition: irsense4.h:367
irsense4_s::slave_address
uint8_t slave_address
Definition: irsense4.h:372
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:423
irsense4_return_value_t
irsense4_return_value_t
IR Sense 4 Click return value data.
Definition: irsense4.h:411
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:351
irsense4_t
struct irsense4_s irsense4_t
IR Sense 4 Click context object.
irsense4_cfg_t::mosi
pin_name_t mosi
Definition: irsense4.h:390
irsense4_cfg_t::cs
pin_name_t cs
Definition: irsense4.h:392
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:424
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.