presence 2.0.0.0
presence.h File Reference

This file contains API for Presence Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  eeprom_data_t
 
struct  presence_t
 Click ctx object definition. More...
 
struct  presence_cfg_t
 Click configuration structure definition. More...
 

Macros

#define PRESENCE_MAP_MIKROBUS(cfg, mikrobus)
 
#define PRESENCE_OK   0
 
#define PRESENCE_ERROR   -1
 
#define PRESENCE_REG_TP_OBJECT_MSB   0x01
 
#define PRESENCE_REG_TP_OBJECT_MID   0x02
 
#define PRESENCE_REG_TP_OBJECT_LSB   0x03
 
#define PRESENCE_REG_TP_AMBIENT_MSB   0x03
 
#define PRESENCE_REG_TP_AMBIENT_LSB   0x04
 
#define PRESENCE_REG_TP_OBJECT_LP1_MSB   0x05
 
#define PRESENCE_REG_TP_OBJECT_LP1_MID   0x06
 
#define PRESENCE_REG_TP_OBJECT_LP1_LSB   0x07
 
#define PRESENCE_REG_TP_OBJECT_LP2_MSB   0x07
 
#define PRESENCE_REG_TP_OBJECT_LP2_MID   0x08
 
#define PRESENCE_REG_TP_OBJECT_LP2_LSB   0x09
 
#define PRESENCE_REG_TP_AMBIENT_LP3_MSB   0x0A
 
#define PRESENCE_REG_TP_AMBIENT_LP3_LSB   0x0B
 
#define PRESENCE_REG_TP_OBJECT_LP2F_MSB   0x0C
 
#define PRESENCE_REG_TP_OBJECT_LP2F_MID   0x0D
 
#define PRESENCE_REG_TP_OBJECT_LP2F_LSB   0x0E
 
#define PRESENCE_REG_TP_PRESENCE   0x0F
 
#define PRESENCE_REG_TP_MOTION   0x10
 
#define PRESENCE_REG_TP_AMBIENT_SHOCK   0x11
 
#define PRESENCE_REG_INTERRUPT_STATUS   0x12
 
#define PRESENCE_REG_CHIP_STATUS   0x13
 
#define PRESENCE_REG_LOW_PASS_TIME_1   0x14
 
#define PRESENCE_REG_LOW_PASS_TIME_2   0x15
 
#define PRESENCE_REG_TP_PRESENCE_THR   0x16
 
#define PRESENCE_REG_TP_MOTION_THR   0x17
 
#define PRESENCE_REG_TP_AMB_SHOCK_THR   0x18
 
#define PRESENCE_REG_INTERRUPT_MASK_1   0x19
 
#define PRESENCE_REG_INTERRUPT_MASK_2   0x1A
 
#define PRESENCE_REG_TIMER_INTERRUPT   0x1B
 
#define PRESENCE_REG_TP_OT_THR_1   0x1C
 
#define PRESENCE_REG_TP_OT_THR_2   0x1D
 
#define PRESENCE_REG_EEPROM_CTRL   0x1F
 
#define PRESENCE_EEPROM_PROTOCOL   0x20
 
#define PRESENCE_EEPROM_CHECKSUM_1   0x21
 
#define PRESENCE_EEPROM_CHECKSUM_2   0x22
 
#define PRESENCE_EEPROM_LOOKUP   0x29
 
#define PRESENCE_EEPROM_PTAT25_1   0x2A
 
#define PRESENCE_EEPROM_PTAT25_2   0x2B
 
#define PRESENCE_EEPROM_M_1   0x2C
 
#define PRESENCE_EEPROM_M_2   0x2D
 
#define PRESENCE_EEPROM_U0_1   0x2E
 
#define PRESENCE_EEPROM_U0_2   0x2F
 
#define PRESENCE_EEPROM_UOUT_1   0x30
 
#define PRESENCE_EEPROM_UOUT_2   0x31
 
#define PRESENCE_EEPROM_TOBJ   0x32
 
#define PRESENCE_EEPROM_SLAVE_ADDR   0x3F
 
#define PRESENCE_DEVICE_SLAVE_ADDRESS   0x0C
 
#define PRESENCE_DEVICE_GEN_CALL_ADDRESS   0x00
 
#define PRESENCE_LOW_PASS_TIME_512S   0x00
 
#define PRESENCE_LOW_PASS_TIME_256S   0x01
 
#define PRESENCE_LOW_PASS_TIME_128S   0x02
 
#define PRESENCE_LOW_PASS_TIME_64S   0x03
 
#define PRESENCE_LOW_PASS_TIME_32S   0x04
 
#define PRESENCE_LOW_PASS_TIME_16S   0x05
 
#define PRESENCE_LOW_PASS_TIME_8S   0x08
 
#define PRESENCE_LOW_PASS_TIME_4S   0x09
 
#define PRESENCE_LOW_PASS_TIME_2S   0x0A
 
#define PRESENCE_LOW_PASS_TIME_1S   0x0B
 
#define PRESENCE_LOW_PASS_TIME_0P50S   0x0C
 
#define PRESENCE_LOW_PASS_TIME_0P25S   0x0D
 
#define PRESENCE_INT_MASK1_TP_OT   0x10
 
#define PRESENCE_INT_MASK1_PRESENCE   0x08
 
#define PRESENCE_INT_MASK1_MOTION   0x04
 
#define PRESENCE_INT_MASK1_AMB_SHOCK   0x02
 
#define PRESENCE_INT_MASK1_TIMER   0x01
 
#define PRESENCE_INT_MASK2_TPOT_DIR   0x10
 
#define PRESENCE_INT_MASK2_SRC_TPOBJ_LP2   ( 0x00 << 2 )
 
#define PRESENCE_INT_MASK2_SRC_LP1_LP2   ( 0x01 << 2 )
 
#define PRESENCE_INT_MASK2_SRC_TPOBJ_LP2FROZEN   ( 0x02 << 2 )
 
#define PRESENCE_INT_MASK2_SRC_LP1_LP2FROZEN   ( 0x03 << 2 )
 
#define PRESENCE_INT_MASK2_CYCLE_TIME_30MS   0x00
 
#define PRESENCE_INT_MASK2_CYCLE_TIME_60MS   0x01
 
#define PRESENCE_INT_MASK2_CYCLE_TIME_120MS   0x02
 
#define PRESENCE_INT_MASK2_CYCLE_TIME_140MS   0x04
 

Functions

void presence_cfg_setup (presence_cfg_t *cfg)
 Config Object Initialization function.
 
err_t presence_init (presence_t *ctx, presence_cfg_t *cfg)
 Initialization function.
 
err_t presence_default_cfg (presence_t *ctx)
 Presence default configuration function.
 
err_t presence_generic_write (presence_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
err_t presence_generic_read (presence_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t presence_get_int_state (presence_t *ctx)
 Get interrupt state function.
 
void presence_general_call_addr (presence_t *ctx)
 General call address.
 
err_t presence_eeprom_process (presence_t *ctx)
 EEPRM PROCESS.
 
float presence_get_calib_constants (presence_t *ctx)
 Calibration constant K.
 
err_t presence_ambient_temperature (presence_t *ctx, float *temperature)
 Ambient Temperature.
 
err_t presence_object_temperature (presence_t *ctx, float *temperature)
 Object Temperature.
 

Detailed Description

This file contains API for Presence Click driver.