proximity8 2.0.0.0
proximity8.h File Reference

This file contains API for Proximity 8 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  proximity8_t
 Click ctx object definition. More...
 
struct  proximity8_cfg_t
 Click configuration structure definition. More...
 

Macros

#define PROXIMITY8_MAP_MIKROBUS(cfg, mikrobus)
 
#define PROXIMITY8_RETVAL   uint8_t
 
#define PROXIMITY8_OK   0x00
 
#define PROXIMITY8_INIT_ERROR   0xFF
 
#define PROXIMITY8_REG_PS_CONFIG_12   0x03
 
#define PROXIMITY8_REG_PS_CONFIG_34   0x04
 
#define PROXIMITY8_REG_THRESHOLD_LOW   0x05
 
#define PROXIMITY8_REG_THRESHOLD_HIGH   0x06
 
#define PROXIMITY8_REG_CANCELLATION_LEVEL   0x07
 
#define PROXIMITY8_REG_PS_CONFIG_5   0x08
 
#define PROXIMITY8_REG_PROX_DATA   0xF2
 
#define PROXIMITY8_REG_INTERRUPT_FLAG   0xF3
 
#define PROXIMITY8_REG_DEVICE_ID   0xF4
 
#define PROXIMITY8_CFG12_PS_IT_1T   0x0000
 
#define PROXIMITY8_CFG12_PS_IT_2T   0x4000
 
#define PROXIMITY8_CFG12_PS_IT_4T   0x8000
 
#define PROXIMITY8_CFG12_PS_IT_8T   0xC000
 
#define PROXIMITY8_CFG12_MPS_1   0x0000
 
#define PROXIMITY8_CFG12_MPS_2   0x1000
 
#define PROXIMITY8_CFG12_MPS_4   0x2000
 
#define PROXIMITY8_CFG12_MPS_8   0x3000
 
#define PROXIMITY8_CFG12_ITB_25us   0x0000
 
#define PROXIMITY8_CFG12_ITB_50us   0x0800
 
#define PROXIMITY8_CFG12_PERIOD_8ms   0x0000
 
#define PROXIMITY8_CFG12_PERIOD_16ms   0x0040
 
#define PROXIMITY8_CFG12_PERIOD_32ms   0x0080
 
#define PROXIMITY8_CFG12_PERIOD_64ms   0x00C0
 
#define PROXIMITY8_CFG12_PERS_1   0x0000
 
#define PROXIMITY8_CFG12_PERS_2   0x0010
 
#define PROXIMITY8_CFG12_PERS_3   0x0020
 
#define PROXIMITY8_CFG12_PERS_4   0x0030
 
#define PROXIMITY8_CFG12_INT_ENABLE   0x0008
 
#define PROXIMITY8_CFG12_INT_DISABLE   0x0004
 
#define PROXIMITY8_CFG12_SMART_PERS_DISABLE   0x0000
 
#define PROXIMITY8_CFG12_SMART_PERS_ENABLE   0x0002
 
#define PROXIMITY8_CFG12_SD_POWER_ON   0x0000
 
#define PROXIMITY8_CFG12_SD_SHUT_DOWN   0x0001
 
#define PROXIMITY8_CFG34_OFF_SUNLIGHT_CANCEL   0x0000
 
#define PROXIMITY8_CFG34_ON_SUNLIGHT_CANCEL   0x8000
 
#define PROXIMITY8_CFG34_SC_CUR_X1   0x0000
 
#define PROXIMITY8_CFG34_SC_CUR_X2   0x2000
 
#define PROXIMITY8_CFG34_SC_CUR_X4   0x4000
 
#define PROXIMITY8_CFG34_SC_CUR_X8   0x6000
 
#define PROXIMITY8_CFG34_PS_OUTPUT_12bit   0x0000
 
#define PROXIMITY8_CFG34_PS_OUTPUT_16bit   0x1000
 
#define PROXIMITY8_CFG34_VCSEL_I_7mA   0x0000
 
#define PROXIMITY8_CFG34_VCSEL_I_11mA   0x0100
 
#define PROXIMITY8_CFG34_VCSEL_I_14mA   0x0200
 
#define PROXIMITY8_CFG34_VCSEL_I_17mA   0x0300
 
#define PROXIMITY8_CFG34_VCSEL_I_20mA   0x0400
 
#define PROXIMITY8_CFG34_AF_MODE_AUTO   0x0000
 
#define PROXIMITY8_CFG34_AF_MODE_FORCE   0x0040
 
#define PROXIMITY8_CFG34_FOR_TRIG_ACTIVE   0x0000
 
#define PROXIMITY8_CFG34_FOR_TRIG_ONE_TIME   0x0020
 
#define PROXIMITY8_DEVICE_ID   0x0588
 
#define PROXIMITY8_DEVICE_SLAVE_ADDRESS   0x60
 

Functions

void proximity8_cfg_setup (proximity8_cfg_t *cfg)
 Config Object Initialization function.
 
PROXIMITY8_RETVAL proximity8_init (proximity8_t *ctx, proximity8_cfg_t *cfg)
 Initialization function.
 
void proximity8_default_cfg (proximity8_t *ctx)
 Click Default Configuration function.
 
void proximity8_generic_write (proximity8_t *ctx, uint8_t reg, uint16_t *data_buf, uint8_t len)
 Generic write function.
 
void proximity8_generic_read (proximity8_t *ctx, uint8_t reg, uint16_t *data_buf)
 Generic read function.
 
uint8_t proximity8_get_interrupt_state (proximity8_t *ctx)
 Get interrupt state on the INT pin.
 

Detailed Description

This file contains API for Proximity 8 Click driver.