ambient6 2.0.0.0
ambient6.h File Reference

This file contains API for Ambient 6 Click driver. More...

#include "drv_digital_out.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  ambient6_t
 Click ctx object definition. More...
 
struct  ambient6_cfg_t
 Click configuration structure definition. More...
 

Macros

#define AMBIENT6_MAP_MIKROBUS(cfg, mikrobus)
 
#define AMBIENT6_RETVAL   uint8_t
 
#define AMBIENT6_OK   0x00
 
#define AMBIENT6_INIT_ERROR   0xFF
 
#define AMBIENT6_CMD_CONFIGURATION   0x00
 
#define AMBIENT6_CMD_THRESHOLD_HIGH_SETTINGS   0x01
 
#define AMBIENT6_CMD_THRESHOLD_LOW_SETTINGS   0x02
 
#define AMBIENT6_CMD_MODE_SETTINGS   0x03
 
#define AMBIENT6_CMD_ALS_DATA   0x04
 
#define AMBIENT6_CMD_WHITE_DATA   0x05
 
#define AMBIENT6_CMD_ALS_THRESHOLD_INTERRUPT   0x06
 
#define AMBIENT6_CFG_ALS_SENSITIVITY_X1   0x0000 << 11
 
#define AMBIENT6_CFG_ALS_SENSITIVITY_X2   0x0001 << 11
 
#define AMBIENT6_CFG_ALS_SENSITIVITY_X1_8   0x0002 << 11
 
#define AMBIENT6_CFG_ALS_SENSITIVITY_X1_4   0x0003 << 11
 
#define AMBIENT6_CFG_ALS_TIME_SETTING_25MS   0x000C << 6
 
#define AMBIENT6_CFG_ALS_TIME_SETTING_50MS   0x0008 << 6
 
#define AMBIENT6_CFG_ALS_TIME_SETTING_100MS   0x0000
 
#define AMBIENT6_CFG_ALS_TIME_SETTING_200MS   0x0001 << 6
 
#define AMBIENT6_CFG_ALS_TIME_SETTING_400MS   0x0002 << 6
 
#define AMBIENT6_CFG_ALS_TIME_SETTING_800MS   0x0003 << 6
 
#define AMBIENT6_CFG_PERSISTENCE_NUMBER_1   0x0000 << 4
 
#define AMBIENT6_CFG_PERSISTENCE_NUMBER_2   0x0001 << 4
 
#define AMBIENT6_CFG_PERSISTENCE_NUMBER_4   0x0002 << 4
 
#define AMBIENT6_CFG_PERSISTENCE_NUMBER_8   0x0003 << 4
 
#define AMBIENT6_CFG_ALS_INT_DISABLE   0x0000
 
#define AMBIENT6_CFG_ALS_INT_ENABLE   0x0001 << 1
 
#define AMBIENT6_CFG_ALS_POWER_ON   0x0000
 
#define AMBIENT6_CFG_ALS_SHUT_DOWN   0x0001
 
#define AMBIENT6_POWER_MODE_1   0x0000
 
#define AMBIENT6_POWER_MODE_2   0x0002
 
#define AMBIENT6_POWER_MODE_3   0x0004
 
#define AMBIENT6_POWER_MODE_4   0x0006
 
#define AMBIENT6_POWER_MODE_ENABLE   0x0001
 
#define AMBIENT6_POWER_MODE_DISABLE   0x0000
 
#define AMBIENT6_DEVICE_SLAVE_ADDRESS   0x10
 

Functions

void ambient6_cfg_setup (ambient6_cfg_t *cfg)
 Config Object Initialization function.
 
AMBIENT6_RETVAL ambient6_init (ambient6_t *ctx, ambient6_cfg_t *cfg)
 Initialization function.
 
void ambient6_default_cfg (ambient6_t *ctx)
 Click Default Configuration function.
 
void ambient6_generic_write (ambient6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void ambient6_generic_read (ambient6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint16_t ambient6_get_ambient_data (ambient6_t *ctx)
 Functions for read 16bit Ambient Data (ALS)
 
void ambient6_settings (ambient6_t *ctx, uint16_t config_data)
 Functions for configuration device for measurement.
 
float ambient6_get_ambient_light (ambient6_t *ctx)
 Functions for get Ambient Light Data.
 

Detailed Description

This file contains API for Ambient 6 Click driver.