proximity9 2.0.0.0
proximity9.h File Reference

This file contains API for Proximity 9 Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  proximity9_t
 Click ctx object definition. More...
 
struct  proximity9_cfg_t
 Click configuration structure definition. More...
 

Macros

#define PROXIMITY9_MAP_MIKROBUS(cfg, mikrobus)
 
#define PROXIMITY9_RETVAL   uint8_t
 
#define PROXIMITY9_OK   0x00
 
#define PROXIMITY9_INIT_ERROR   0xFF
 
#define PROXIMITY9_DEV_ADDR   0x60
 
#define PROXIMITY9_ALS_CONF_REG   0x00
 
#define PROXIMITY9_ALS_THRSHD_H_REG   0x01
 
#define PROXIMITY9_ALS_THRSHD_L_REG   0x02
 
#define PROXIMITY9_PS_CONF_REG   0x03
 
#define PROXIMITY9_PS_MS_REG   0x04
 
#define PROXIMITY9_PS_CANC_REG   0x05
 
#define PROXIMITY9_PS_THRSHD_L_REG   0x06
 
#define PROXIMITY9_PS_THRSHD_H_REG   0x07
 
#define PROXIMITY9_PS_DATA_REG   0x08
 
#define PROXIMITY9_ALS_DATA_REG   0x09
 
#define PROXIMITY9_WHITE_DATA_REG   0x0A
 
#define PROXIMITY9_INT_FLAG_REG   0x0B
 
#define PROXIMITY9_DEV_ID_REG   0x0C
 
#define PROXIMITY9_ALS_IT_80_MS   0x00
 
#define PROXIMITY9_ALS_IT_160_MS   0x40
 
#define PROXIMITY9_ALS_IT_320_MS   0x80
 
#define PROXIMITY9_ALS_IT_640_MS   0xC0
 
#define PROXIMITY9_ALS_PERS_1   0x00
 
#define PROXIMITY9_ALS_PERS_2   0x04
 
#define PROXIMITY9_ALS_PERS_4   0x08
 
#define PROXIMITY9_ALS_PERS_8   0x0C
 
#define PROXIMITY9_ALS_INT_EN   0x02
 
#define PROXIMITY9_ALS_SHUTDOWN   0x01
 
#define PROXIMITY9_PS_IR_ON_1_OFF_40   0x00
 
#define PROXIMITY9_PS_IR_ON_1_OFF_80   0x40
 
#define PROXIMITY9_PS_IR_ON_1_OFF_160   0x80
 
#define PROXIMITY9_PS_IR_ON_1_OFF_320   0xC0
 
#define PROXIMITY9_PS_PERS_1   0x00
 
#define PROXIMITY9_PS_PERS_2   0x10
 
#define PROXIMITY9_PS_PERS_3   0x20
 
#define PROXIMITY9_PS_PERS_4   0x30
 
#define PROXIMITY9_PS_IT_1T   0x00
 
#define PROXIMITY9_PS_IT_1T5   0x02
 
#define PROXIMITY9_PS_IT_2T   0x04
 
#define PROXIMITY9_PS_IT_2T5   0x06
 
#define PROXIMITY9_PS_IT_3T   0x08
 
#define PROXIMITY9_PS_IT_3T5   0x0A
 
#define PROXIMITY9_PS_IT_4T   0x0C
 
#define PROXIMITY9_PS_IT_8T   0x0E
 
#define PROXIMITY9_PS_SHUTDOWN   0x01
 
#define PROXIMITY9_PS_OUTPUT_12BIT   0x0000
 
#define PROXIMITY9_PS_OUTPUT_16BIT   0x0800
 
#define PROXIMITY9_PS_INT_TRIGGER_CLOSE   0x0100
 
#define PROXIMITY9_PS_INT_TRIGGER_AWAY   0x0200
 
#define PROXIMITY9_PS_INT_TRIGGER_BOTH   0x0300
 
#define PROXIMITY9_PS_SMART_PERS_EN   0x10
 
#define PROXIMITY9_PS_ACT_FORCE_EN   0x08
 
#define PROXIMITY9_PS_TRIG_ONE_CYCLE   0x04
 
#define PROXIMITY9_WHITE_CH_DIS   0x8000
 
#define PROXIMITY9_PS_NORMAL_OP_MODE   0x0000
 
#define PROXIMITY9_PS_DET_LOGIC_MODE   0x4000
 
#define PROXIMITY9_LED_I_50_MA   0x0000
 
#define PROXIMITY9_LED_I_75_MA   0x0100
 
#define PROXIMITY9_LED_I_100_MA   0x0200
 
#define PROXIMITY9_LED_I_120_MA   0x0300
 
#define PROXIMITY9_LED_I_140_MA   0x0400
 
#define PROXIMITY9_LED_I_160_MA   0x0500
 
#define PROXIMITY9_LED_I_180_MA   0x0600
 
#define PROXIMITY9_LED_I_200_MA   0x0700
 
#define PROXIMITY9_PS_ENTER_PROT_MODE_FLAG   0x40
 
#define PROXIMITY9_ALS_IF_L_FLAG   0x20
 
#define PROXIMITY9_ALS_IF_H_FLAG   0x10
 
#define PROXIMITY9_PS_IF_CLOSE_FLAG   0x02
 
#define PROXIMITY9_PS_IF_AWAY_FLAG   0x01
 
#define PROXIMITY9_INT_CLEARED   0x00
 
#define PROXIMITY9_INVALID_ADDR   0x01
 
#define PROXIMITY9_OK   0x00
 

Functions

void proximity9_cfg_setup (proximity9_cfg_t *cfg)
 Config Object Initialization function.
 
PROXIMITY9_RETVAL proximity9_init (proximity9_t *ctx, proximity9_cfg_t *cfg)
 Initialization function.
 
void proximity9_default_cfg (proximity9_t *ctx)
 Click Default Configuration function.
 
void proximity9_generic_write (proximity9_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void proximity9_generic_read (proximity9_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
PROXIMITY9_RETVAL proximity9_read_register (proximity9_t *ctx, uint8_t reg_addr, uint16_t *data_out)
 Generic Read function.
 
PROXIMITY9_RETVAL proximity9_write_register (proximity9_t *ctx, uint8_t reg_addr, uint16_t data_in)
 Generic Write function.
 
uint8_t proximity9_check_int_pin (proximity9_t *ctx)
 INT Pin Check function.
 
uint8_t proximity9_check_int_flag (proximity9_t *ctx, uint8_t bit_mask)
 INT Flag Check function.
 
float proximity9_get_als_lux (proximity9_t *ctx)
 ALS Get function.
 

Detailed Description

This file contains API for Proximity 9 Click driver.