ambient3 2.0.0.0
ambient3.h File Reference

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

Macros

#define AMBIENT3_MAP_MIKROBUS(cfg, mikrobus)
 
#define AMBIENT3_RETVAL   uint8_t
 
#define AMBIENT3_OK   0x00
 
#define AMBIENT3_INIT_ERROR   0xFF
 
#define AMBIENT3_DEVICE_SLAVE_ADDRESS   0x49
 
#define AMBIENT3_REG_HW_VERSION_MSB   0x00
 
#define AMBIENT3_REG_HW_VERSION_LSB   0x01
 
#define AMBIENT3_REG_FW_VERSION_MSB   0x02
 
#define AMBIENT3_REG_FW_VERSION_LSB   0x03
 
#define AMBIENT3_REG_CONF_CONTROL   0x04
 
#define AMBIENT3_REG_INTEGRATION_TIME   0x05
 
#define AMBIENT3_REG_DEVICE_TEMP   0x06
 
#define AMBIENT3_REG_LED_CONFIG   0x07
 
#define AMBIENT3_REG_ESP   0x4F
 
#define AMBIENT3_REG_DIR_CONFIG   0x60
 
#define AMBIENT3_REG_DIR_CONTROL   0x61
 
#define AMBIENT3_REG_DIR_CH_1_MSB   0x62
 
#define AMBIENT3_REG_DIR_CH_1_LSB   0x63
 
#define AMBIENT3_REG_DIR_CH_2_MSB   0x64
 
#define AMBIENT3_REG_DIR_CH_2_LSB   0x65
 
#define AMBIENT3_REG_DIR_CH_3_MSB   0x66
 
#define AMBIENT3_REG_DIR_CH_3_LSB   0x67
 
#define AMBIENT3_REG_DIR_LUXT_MSB   0x70
 
#define AMBIENT3_REG_DIR_LUXT_LSB   0x71
 
#define AMBIENT3_REG_DIR_CCTT_MSB   0x72
 
#define AMBIENT3_REG_DIR_CCTT_LSB   0x73
 
#define AMBIENT3_REG_RAW_VALUE_0_MSB   0x08
 
#define AMBIENT3_REG_RAW_VALUE_0_LSB   0x09
 
#define AMBIENT3_REG_RAW_VALUE_1_MSB   0x0A
 
#define AMBIENT3_REG_RAW_VALUE_1_LSB   0x0B
 
#define AMBIENT3_REG_RAW_VALUE_2_MSB   0x0C
 
#define AMBIENT3_REG_RAW_VALUE_2_LSB   0x0D
 
#define AMBIENT3_REG_RAW_VALUE_3_MSB   0x0E
 
#define AMBIENT3_REG_RAW_VALUE_3_LSB   0x0F
 
#define AMBIENT3_REG_RAW_VALUE_4_MSB   0x10
 
#define AMBIENT3_REG_RAW_VALUE_4_LSB   0x11
 
#define AMBIENT3_REG_RAW_VALUE_5_MSB   0x12
 
#define AMBIENT3_REG_RAW_VALUE_5_LSB   0x13
 
#define AMBIENT3_REG_COEF_DATA_0   0x50
 
#define AMBIENT3_REG_COEF_DATA_1   0x51
 
#define AMBIENT3_REG_COEF_DATA_2   0x52
 
#define AMBIENT3_REG_COEF_DATA_3   0x53
 
#define AMBIENT3_REG_COEF_READ   0x54
 
#define AMBIENT3_REG_COEF_WRITE   0x55
 
#define AMBIENT3_REG_X_CALIBRATED_B1   0x14
 
#define AMBIENT3_REG_X_CALIBRATED_B2   0x15
 
#define AMBIENT3_REG_X_CALIBRATED_B3   0x16
 
#define AMBIENT3_REG_X_CALIBRATED_B4   0x17
 
#define AMBIENT3_REG_Y_CALIBRATED_B1   0x18
 
#define AMBIENT3_REG_Y_CALIBRATED_B2   0x19
 
#define AMBIENT3_REG_Y_CALIBRATED_B3   0x1A
 
#define AMBIENT3_REG_Y_CALIBRATED_B4   0x1B
 
#define AMBIENT3_REG_Z_CALIBRATED_B1   0x1C
 
#define AMBIENT3_REG_Z_CALIBRATED_B2   0x1D
 
#define AMBIENT3_REG_Z_CALIBRATED_B3   0x1E
 
#define AMBIENT3_REG_Z_CALIBRATED_B4   0x1F
 
#define AMBIENT3_REG_CIE1931_X_CALIBRATED_B1   0x20
 
#define AMBIENT3_REG_CIE1931_X_CALIBRATED_B2   0x21
 
#define AMBIENT3_REG_CIE1931_X_CALIBRATED_B3   0x22
 
#define AMBIENT3_REG_CIE1931_X_CALIBRATED_B4   0x23
 
#define AMBIENT3_REG_CIE1931_Y_CALIBRATED_B1   0x24
 
#define AMBIENT3_REG_CIE1931_Y_CALIBRATED_B2   0x25
 
#define AMBIENT3_REG_CIE1931_Y_CALIBRATED_B3   0x26
 
#define AMBIENT3_REG_CIE1931_Y_CALIBRATED_B4   0x27
 
#define AMBIENT3_REG_U_PRI_CALIBRATED_B1   0x28
 
#define AMBIENT3_REG_U_PRI_CALIBRATED_B2   0x29
 
#define AMBIENT3_REG_U_PRI_CALIBRATED_B3   0x2A
 
#define AMBIENT3_REG_U_PRI_CALIBRATED_B4   0x2B
 
#define AMBIENT3_REG_V_PRI_CALIBRATED_B1   0x2C
 
#define AMBIENT3_REG_V_PRI_CALIBRATED_B2   0x2D
 
#define AMBIENT3_REG_V_PRI_CALIBRATED_B3   0x2E
 
#define AMBIENT3_REG_V_PRI_CALIBRATED_B4   0x2F
 
#define AMBIENT3_REG_U_CALIBRATED_B1   0x30
 
#define AMBIENT3_REG_U_CALIBRATED_B2   0x31
 
#define AMBIENT3_REG_U_CALIBRATED_B3   0x32
 
#define AMBIENT3_REG_U_CALIBRATED_B4   0x33
 
#define AMBIENT3_REG_V_CALIBRATED_B1   0x34
 
#define AMBIENT3_REG_V_CALIBRATED_B2   0x35
 
#define AMBIENT3_REG_V_CALIBRATED_B3   0x36
 
#define AMBIENT3_REG_V_CALIBRATED_B4   0x37
 
#define AMBIENT3_REG_DUV_CALIBRATED_B1   0x38
 
#define AMBIENT3_REG_DUV_CALIBRATED_B2   0x39
 
#define AMBIENT3_REG_DUV_CALIBRATED_B3   0x3A
 
#define AMBIENT3_REG_DUV_CALIBRATED_B4   0x3B
 
#define AMBIENT3_REG_CAL_LUX_MSB   0x3C
 
#define AMBIENT3_REG_CAL_LUX_LSB   0x3D
 
#define AMBIENT3_REG_CAL_CCT_MSB   0x3E
 
#define AMBIENT3_REG_CAL_CCT_LSB   0x3F
 
#define AMBIENT3_CC_GAIN_x1   0x00
 
#define AMBIENT3_CC_GAIN_x3_7   0x10
 
#define AMBIENT3_CC_GAIN_x16   0x20
 
#define AMBIENT3_CC_GAIN_x64   0x30
 
#define AMBIENT3_CC_RDY_TO_INT   0x02
 
#define AMBIENT3_CC_SOFTWARE_RESET   0x01
 

Functions

void ambient3_cfg_setup (ambient3_cfg_t *cfg)
 Config Object Initialization function.
 
AMBIENT3_RETVAL ambient3_init (ambient3_t *ctx, ambient3_cfg_t *cfg)
 Initialization function.
 
void ambient3_default_cfg (ambient3_t *ctx)
 Default Config Initialization function.
 
void ambient3_write_byte (ambient3_t *ctx, uint8_t virtual_reg, uint8_t data_buf)
 Write function.
 
uint8_t ambient3_read_byte (ambient3_t *ctx, uint8_t virtual_reg)
 Read function.
 
void ambient3_hardware_reset (ambient3_t *ctx)
 Hardware reset function.
 
uint8_t ambient3_get_device_temperature (ambient3_t *ctx)
 Getting temperature function.
 
uint16_t ambient3_get_data_in_lux (ambient3_t *ctx)
 This function reads data in LUX.
 
uint16_t ambient3_get_cct_data (ambient3_t *ctx)
 This function reads CCT data in K.
 
uint8_t ambient3_get_interrupt (ambient3_t *ctx)
 This function reads interrupt state.
 

Detailed Description

This file contains API for Ambient 3 Click driver.