ambient8 2.0.0.0
ambient8.h File Reference

This file contains API for Ambient 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  ambient8_t
 Click ctx object definition. More...
 
struct  ambient8_cfg_t
 Click configuration structure definition. More...
 

Macros

#define AMBIENT8_MAP_MIKROBUS(cfg, mikrobus)
 
#define AMBIENT8_RETVAL   uint8_t
 
#define AMBIENT8_OK   0x00
 
#define AMBIENT8_INIT_ERROR   0xFF
 
#define AMBIENT8_DEVICE_ADDRESS   0x29
 
#define AMBIENT8_ALS_CONTROL   0x80
 
#define AMBIENT8_ALS_MEASUREMENT_RATE   0x85
 
#define AMBIENT8_PART_ID   0x86
 
#define AMBIENT8_MANUFACTURER_ID   0x87
 
#define AMBIENT8_ALS_DATA_CH1_0   0x88
 
#define AMBIENT8_ALS_DATA_CH1_1   0x89
 
#define AMBIENT8_ALS_DATA_CH0_0   0x8A
 
#define AMBIENT8_ALS_DATA_CH0_1   0x8B
 
#define AMBIENT8_ALS_STATUS   0x8C
 
#define AMBIENT8_ALS_GAIN_1X   0x00
 
#define AMBIENT8_ALS_GAIN_2X   0x04
 
#define AMBIENT8_ALS_GAIN_4X   0x08
 
#define AMBIENT8_ALS_GAIN_8X   0x0C
 
#define AMBIENT8_ALS_GAIN_48X   0x18
 
#define AMBIENT8_ALS_GAIN_96X   0x1C
 
#define AMBIENT8_SW_RESET   0x02
 
#define AMBIENT8_ALS_MODE_STANDBY   0x00
 
#define AMBIENT8_ALS_MODE_ACTIVE   0x01
 
#define AMBIENT8_ALS_INTEGRATION_TIME_100ms   0x00
 
#define AMBIENT8_ALS_INTEGRATION_TIME_50ms   0x08
 
#define AMBIENT8_ALS_INTEGRATION_TIME_200ms   0x10
 
#define AMBIENT8_ALS_INTEGRATION_TIME_400ms   0x18
 
#define AMBIENT8_ALS_INTEGRATION_TIME_150ms   0x20
 
#define AMBIENT8_ALS_INTEGRATION_TIME_250ms   0x28
 
#define AMBIENT8_ALS_INTEGRATION_TIME_300ms   0x30
 
#define AMBIENT8_ALS_INTEGRATION_TIME_350ms   0x38
 
#define AMBIENT8_ALS_MEASUREMENT_RATE_50   0x00
 
#define AMBIENT8_ALS_MEASUREMENT_RATE_100   0x01
 
#define AMBIENT8_ALS_MEASUREMENT_RATE_200   0x02
 
#define AMBIENT8_ALS_MEASUREMENT_RATE_500   0x03
 
#define AMBIENT8_ALS_MEASUREMENT_RATE_1000   0x04
 
#define AMBIENT8_ALS_MEASUREMENT_RATE_2000   0x07
 

Functions

void ambient8_cfg_setup (ambient8_cfg_t *cfg)
 Config Object Initialization function.
 
AMBIENT8_RETVAL ambient8_init (ambient8_t *ctx, ambient8_cfg_t *cfg)
 Initialization function.
 
void ambient8_set_register (ambient8_t *ctx, uint8_t *write_buf, uint8_t n_bytes)
 Writing to device registers.
 
void ambient8_get_register (ambient8_t *ctx, uint8_t reg_addr, uint8_t *data_buf, uint8_t n_bytes)
 Reading register value(s).
 
void ambient8_set_constants (ambient8_t *ctx)
 Setting constants for lux level calculation.
 
AMBIENT8_RETVAL ambient8_get_als_data (ambient8_t *ctx, uint16_t *als_data_ch1, uint16_t *als_data_ch0)
 Reading ALS data.
 
AMBIENT8_RETVAL ambient8_get_lux_level (ambient8_t *ctx, float *lux_level, float window_factor, float IR_factor)
 Calculating lux level.
 

Detailed Description

This file contains API for Ambient 8 Click driver.