proximity3 2.0.0.0
proximity3.h File Reference

This file contains API for Proximity 3 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  proximity3_t
 Click ctx object definition. More...
 
struct  proximity3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define PROXIMITY3_MAP_MIKROBUS(cfg, mikrobus)
 
#define PROXIMITY3_OK   0
 
#define PROXIMITY3_ERROR   -1
 
#define PROXIMITY3_I2CADDR   0x51
 
#define PROXIMITY3_ALS_CONF_REG   0x00
 
#define PROXIMITY3_ALS_THDH_REG   0x01
 
#define PROXIMITY3_ALS_THDL_REG   0x02
 
#define PROXIMITY3_PS_CONF1_CONF2_REG   0x03
 
#define PROXIMITY3_PS_CONF3_MS_REG   0x04
 
#define PROXIMITY3_PS_CANC_REG   0x05
 
#define PROXIMITY3_PS_THDL_REG   0x06
 
#define PROXIMITY3_PS_THDH_REG   0x07
 
#define PROXIMITY3_PROXIMITY_REG   0x08
 
#define PROXIMITY3_AMBIENT_REG   0x09
 
#define PROXIMITY3_WHITE_REG   0x0A
 
#define PROXIMITY3_INT_FLAG_REG   0x0D
 
#define PROXIMITY3_DEVICE_ID_REG   0x0E
 
#define PROXIMITY3_DEVICE_ID_VALUE   0x1058
 
#define PROXIMITY3_ALS_CONF_CONFIG   0x0040
 
#define PROXIMITY3_PS_CONF1_CONF2_CONFIG   0x0A2A
 
#define PROXIMITY3_PS_CONF3_MS_CONFIG   0x0770
 
#define PROXIMITY3_PS_THDL_CONFIG   0x1388
 
#define PROXIMITY3_PS_THDH_CONFIG   0x2EE0
 

Functions

void proximity3_cfg_setup (proximity3_cfg_t *cfg)
 Config Object Initialization function.
 
err_t proximity3_init (proximity3_t *ctx, proximity3_cfg_t *cfg)
 Initialization function.
 
err_t proximity3_default_cfg (proximity3_t *ctx)
 Proximity 3 default configuration function.
 
err_t proximity3_write_16 (proximity3_t *ctx, uint8_t reg_address, uint16_t data_in)
 Generic write function.
 
uint16_t proximity3_read_16 (proximity3_t *ctx, uint8_t reg_address)
 Generic read function.
 
uint16_t proximity3_read_als (proximity3_t *ctx)
 Read ambient light sensor data.
 
uint16_t proximity3_read_proximity (proximity3_t *ctx)
 Read proximity.
 

Detailed Description

This file contains API for Proximity 3 Click driver.