proximity11 2.0.0.0
proximity11.h File Reference

This file contains API for Proximity 11 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  als_data_t
 
struct  proximity11_t
 Click ctx object definition. More...
 
struct  proximity11_cfg_t
 Click configuration structure definition. More...
 

Macros

#define PROXIMITY11_MAP_MIKROBUS(cfg, mikrobus)
 
#define PROXIMITY11_RETVAL   uint8_t
 
#define PROXIMITY11_OK   0x00
 
#define PROXIMITY11_INIT_ERROR   0xFF
 
#define PROXIMITY11_DEVICE_ADDRESS   0x38
 
#define PROXIMITY11_SYS_CTRL   0x40
 
#define PROXIMITY11_MODE_CTRL   0x41
 
#define PROXIMITY11_ALS_PS_CTRL   0x42
 
#define PROXIMITY11_PS_CTRL   0x43
 
#define PROXIMITY11_PS_DATA_LSB   0x44
 
#define PROXIMITY11_PS_DATA_MSB   0x45
 
#define PROXIMITY11_ALS_DATA0_LSB   0x46
 
#define PROXIMITY11_ALS_DATA0_MSB   0x47
 
#define PROXIMITY11_ALS_DATA1_LSB   0x48
 
#define PROXIMITY11_ALS_DATA1_MSB   0x49
 
#define PROXIMITY11_INTERRUPT   0x4A
 
#define PROXIMITY11_PS_TH_LSB   0x4B
 
#define PROXIMITY11_PS_TH_MSB   0x4C
 
#define PROXIMITY11_PS_TL_LSB   0x4D
 
#define PROXIMITY11_PS_TL_MSB   0x4E
 
#define PROXIMITY11_ALS_DATA0_TH_LSB   0x4F
 
#define PROXIMITY11_ALS_DATA0_TH_MSB   0x50
 
#define PROXIMITY11_ALS_DATA0_TL_LSB   0x51
 
#define PROXIMITY11_ALS_DATA0_TL_MSB   0x52
 
#define PROXIMITY11_PS_OFFSET_LSB   0x53
 
#define PROXIMITY11_PS_OFFSET_MSB   0x54
 
#define PROXIMITY11_MANUFACT_ID   0x92
 

Functions

void proximity11_cfg_setup (proximity11_cfg_t *cfg)
 Config Object Initialization function.
 
PROXIMITY11_RETVAL proximity11_init (proximity11_t *ctx, proximity11_cfg_t *cfg)
 Initialization function.
 
uint8_t proximity11_default_cfg (proximity11_t *ctx)
 Click Default Configuration function.
 
void proximity11_generic_write (proximity11_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void proximity11_generic_read (proximity11_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t proximity11_int_get (proximity11_t *ctx)
 Int pin get functuin.
 
uint8_t proximity11_get (proximity11_t *ctx, uint8_t register_address, uint8_t *output_buffer, uint8_t n_bytes)
 Proximity value get function.
 
uint8_t proximity11_set (proximity11_t *ctx, uint8_t register_address, uint8_t *input_buffer, uint8_t n_bytes)
 Proximity value set function.
 
void proximity11_update (proximity11_t *ctx)
 Updating data for Lux calculation.
 
float proximity11_convert_lx (proximity11_t *ctx, uint16_t *input_data)
 Converting raw data to Lux.
 
void proximity11_get_raw_ps_als_values (proximity11_t *ctx, uint8_t *data_buffer)
 Getting raw ALS and PS data.
 
void proximity11_get_ps_als_values (proximity11_t *ctx, uint16_t *ps_value, float *als_value)
 Getting ALS and PS values.
 
uint8_t proximity11_set_ps_threshold_high (proximity11_t *ctx, uint16_t threshold_value)
 Setting High PS threshold value.
 
uint8_t proximity11_set_ps_threshold_low (proximity11_t *ctx, uint16_t threshold_value)
 Setting Low PS threshold value.
 
void proximity11_set_als_threshold_high (proximity11_t *ctx, uint16_t threshold_value)
 Setting High Als threshold value.
 
void proximity11_set_als_threshold_low (proximity11_t *ctx, uint16_t threshold_value)
 Setting Low Als threshold value.
 
uint8_t proximity11_set_ps_offset (proximity11_t *ctx, uint16_t offset_value)
 Setting PS offset value.
 

Detailed Description

This file contains API for Proximity 11 Click driver.