irsense3 2.0.0.0
irsense3.h File Reference

This file contains API for IR Sense 3 Click driver. More...

#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  irsense3_t
 Click ctx object definition. More...
 
struct  irsense3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define IRSENSE3_MAP_MIKROBUS(cfg, mikrobus)
 
#define IRSENSE3_RETVAL   uint8_t
 
#define IRSENSE3_OK   0x00
 
#define IRSENSE3_INIT_ERROR   0xFF
 
#define IRSENSE3_REG_COMPANY_CODE   0x00
 
#define IRSENSE3_REG_DEVICE_ID   0x01
 
#define IRSENSE3_REG_INFO_1   0x02
 
#define IRSENSE3_REG_INFO_2   0x03
 
#define IRSENSE3_REG_STATUS_1   0x04
 
#define IRSENSE3_REG_IR_LSB   0x05
 
#define IRSENSE3_REG_IR_MSB   0x06
 
#define IRSENSE3_REG_TEMP_LSB   0x07
 
#define IRSENSE3_REG_TEMP_MSB   0x08
 
#define IRSENSE3_REG_STATUS_2   0x09
 
#define IRSENSE3_REG_STATUS_3   0x0A
 
#define IRSENSE3_REG_STATUS_4   0x1F
 
#define IRSENSE3_REG_CTRL_1   0x20
 
#define IRSENSE3_REG_CTRL_2   0x21
 
#define IRSENSE3_REG_CTRL_3   0x22
 
#define IRSENSE3_REG_CTRL_4   0x23
 
#define IRSENSE3_REG_CTRL_5   0x24
 
#define IRSENSE3_REG_CTRL_6   0x25
 
#define IRSENSE3_REG_CTRL_7   0x26
 
#define IRSENSE3_REG_CTRL_8   0x27
 
#define IRSENSE3_REG_CTRL_9   0x28
 
#define IRSENSE3_REG_CTRL_10   0x29
 
#define IRSENSE3_REG_CTRL_11   0x2A
 
#define IRSENSE3_REG_CTRL_12   0x2B
 
#define IRSENSE3_DEVICE_ID   0x15
 
#define IRSENSE3_COMPANY_CODE   0x48
 
#define IRSENSE3_CTRL1_NORMAL_STATE   0xFE
 
#define IRSENSE3_CTRL1_SOFTWARE_RESET   0xFF
 
#define IRSENSE3_CTRL2_NO_SYNC   0xFC
 
#define IRSENSE3_CTRL2_MASTER_SYNC   0xFD
 
#define IRSENSE3_CTRL2_SLAVE_SYNC   0xFE
 
#define IRSENSE3_CTRL3_LOW_NOISE_DISABLE   0x80
 
#define IRSENSE3_CTRL3_LOW_NOISE_ENABLE   0xC0
 
#define IRSENSE3_CTRL3_ODR_1Hz   0x80
 
#define IRSENSE3_CTRL3_ODR_2Hz   0x90
 
#define IRSENSE3_CTRL3_ODR_10Hz   0xA0
 
#define IRSENSE3_CTRL3_ODR_50Hz   0xB0
 
#define IRSENSE3_CTRL3_NO_TEMP_FILTER   0x80
 
#define IRSENSE3_CTRL3_TEMP_FILTER_0p9Hz   0x84
 
#define IRSENSE3_CTRL3_TEMP_FILTER_0p445Hz   0x88
 
#define IRSENSE3_CTRL3_NO_IR_FILTER   0x80
 
#define IRSENSE3_CTRL3_IR_FILTER_0p9Hz   0x81
 
#define IRSENSE3_CTRL3_IR_FILTER_0p445Hz   0x82
 
#define IRSENSE3_CTRL4_TOPT_THR_DISABLE   0xF8
 
#define IRSENSE3_CTRL4_TOPT_THR_ENABLE   0xFC
 
#define IRSENSE3_CTRL4_TOPT_NOISE_DISABLE   0xF8
 
#define IRSENSE3_CTRL4_TOPT_NOISE_ENABLE   0xFB
 
#define IRSENSE3_CTRL7_HUMAN_DETECT_NORMAL   0xF0
 
#define IRSENSE3_CTRL7_HUMAN_DETECT_INVERT   0xF8
 
#define IRSENSE3_CTRL7_HUMAN_DETECT_TIME_0sec   0xF0
 
#define IRSENSE3_CTRL7_HUMAN_DETECT_TIME_5sec   0xF1
 
#define IRSENSE3_CTRL7_HUMAN_DETECT_TIME_10sec   0xF2
 
#define IRSENSE3_CTRL7_HUMAN_DETECT_TIME_30sec   0xF3
 
#define IRSENSE3_CTRL7_HUMAN_DETECT_TIME_300sec   0xF4
 
#define IRSENSE3_CTRL11_HBDEN_OFF   0xE0
 
#define IRSENSE3_CTRL11_HBDEN_ON   0xF0
 
#define IRSENSE3_CTRL11_DO_NOT_STOP_UPDATING_SB   0xE0
 
#define IRSENSE3_CTRL11_STOP_UPDATING_SB   0xE8
 
#define IRSENSE3_CTRL11_STREAMING_BUFFER_OFF   0xE0
 
#define IRSENSE3_CTRL11_STREAMING_BUFFER_ON   0xE4
 
#define IRSENSE3_CTRL11_INT_HUMAN_DISABLE   0xE0
 
#define IRSENSE3_CTRL11_INT_HUMAN_ENABLE   0xE2
 
#define IRSENSE3_CTRL11_INT_DRDY_DISABLE   0xE0
 
#define IRSENSE3_CTRL11_INT_DRDY_ENABLE   0xE1
 
#define IRSENSE3_CTRL12_STANDBY_MODE   0xFE
 
#define IRSENSE3_CTRL12_CONTINUOUS_MODE   0xFF
 
#define IRSENSE3_PRESENCE_IS_DETECTED   0x01
 
#define IRSENSE3_PRESENCE_IS_NOT_DETECTED   0x00
 

Functions

void irsense3_cfg_setup (irsense3_cfg_t *cfg)
 Config Object Initialization function.
 
IRSENSE3_RETVAL irsense3_init (irsense3_t *ctx, irsense3_cfg_t *cfg)
 Initialization function.
 
void irsense3_default_cfg (irsense3_t *ctx)
 Click Default Configuration function.
 
void irsense3_generic_write (irsense3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void irsense3_generic_read (irsense3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t irsense3_get_interrupt_state (irsense3_t *ctx)
 Get Interrupt state.
 
float irsense3_get_temperature_data (irsense3_t *ctx)
 Temperature data.
 
float irsense3_get_ir_sensor_data (irsense3_t *ctx)
 Output current of IR sensor.
 
uint8_t irsense3_human_approach_detect (irsense3_t *ctx)
 Human approach detection.
 
void irsense3_software_reset (irsense3_t *ctx)
 Software reset.
 

Detailed Description

This file contains API for IR Sense 3 Click driver.