ambient22 2.1.0.0
ambient22.h File Reference

This file contains API for Ambient 22 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  ambient22_t
 Ambient 22 Click context object. More...
 
struct  ambient22_cfg_t
 Ambient 22 Click configuration object. More...
 

Macros

#define AMBIENT22_REG_RESULT   0x00
 Ambient 22 register list.
 
#define AMBIENT22_REG_CONFIGURATION   0x01
 
#define AMBIENT22_REG_LOW_LIMIT   0x02
 
#define AMBIENT22_REG_HIGH_LIMIT   0x03
 
#define AMBIENT22_REG_MANUFACTURER_ID   0x7E
 
#define AMBIENT22_REG_DEVICE_ID   0x7F
 
#define AMBIENT22_CONFIG_RN_AUTO_SCALE   0xC000u
 Ambient 22 configuration setting.
 
#define AMBIENT22_CONFIG_RN_MASK   0xF000u
 
#define AMBIENT22_CONFIG_CT_100_mS   0x0000u
 
#define AMBIENT22_CONFIG_CT_800_mS   0x0800u
 
#define AMBIENT22_CONFIG_CT_MASK   0x0800u
 
#define AMBIENT22_CONFIG_M_SHUTDOWN   0x0000u
 
#define AMBIENT22_CONFIG_M_SINGLE   0x0200u
 
#define AMBIENT22_CONFIG_M_CONTINUOUS   0x0400u
 
#define AMBIENT22_CONFIG_M_MASK   0x0600u
 
#define AMBIENT22_CONFIG_OVF_MASK   0x0100u
 
#define AMBIENT22_CONFIG_CRF_MASK   0x0080u
 
#define AMBIENT22_CONFIG_FH_MASK   0x0040u
 
#define AMBIENT22_CONFIG_FL_MASK   0x0020u
 
#define AMBIENT22_CONFIG_L_TRANSPARENT   0x0000u
 
#define AMBIENT22_CONFIG_L_LATCH   0x0010u
 
#define AMBIENT22_CONFIG_L_MASK   0x0010u
 
#define AMBIENT22_CONFIG_POL_LOW   0x0000u
 
#define AMBIENT22_CONFIG_POL_HIGH   0x0008u
 
#define AMBIENT22_CONFIG_POL_MASK   0x0008u
 
#define AMBIENT22_CONFIG_ME_MASK   0x0004u
 
#define AMBIENT22_CONFIG_FC_ONE   0x0000u
 
#define AMBIENT22_CONFIG_FC_TWO   0x0001u
 
#define AMBIENT22_CONFIG_FC_FOUR   0x0002u
 
#define AMBIENT22_CONFIG_FC_EIGHT   0x0003u
 
#define AMBIENT22_CONFIG_FC_MASK   0x0003u
 
#define AMBIENT22_RESULT_EXP   0xF000u
 Ambient 22 lux calculation setting.
 
#define AMBIENT22_RESULT_FRACT   0x0FFFu
 
#define AMBIENT22_RESULT_MIN   0x0000u
 
#define AMBIENT22_RESULT_MAX   0xBFFFu
 
#define AMBIENT22_RESULT_LUX_PER_LSB   0.02f
 
#define AMBIENT22_MANUFACTURER_ID   0x5449u
 Ambient 22 device ID setting.
 
#define AMBIENT22_DEVICE_ID   0x3001u
 
#define AMBIENT22_DEVICE_ADDRESS_0   0x44
 Ambient 22 device address setting.
 
#define AMBIENT22_DEVICE_ADDRESS_1   0x45
 
#define AMBIENT22_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  ambient22_return_value_t { AMBIENT22_OK = 0 , AMBIENT22_ERROR = -1 }
 Ambient 22 Click return value data. More...
 

Functions

void ambient22_cfg_setup (ambient22_cfg_t *cfg)
 Ambient 22 configuration object setup function.
 
err_t ambient22_init (ambient22_t *ctx, ambient22_cfg_t *cfg)
 Ambient 22 initialization function.
 
err_t ambient22_default_cfg (ambient22_t *ctx)
 Ambient 22 default configuration function.
 
err_t ambient22_write_register (ambient22_t *ctx, uint8_t reg, uint16_t data_in)
 Ambient 22 write register function.
 
err_t ambient22_read_register (ambient22_t *ctx, uint8_t reg, uint16_t *data_out)
 Ambient 22 read register function.
 
err_t ambient22_check_communication (ambient22_t *ctx)
 Ambient 22 check communication function.
 
err_t ambient22_read_lux (ambient22_t *ctx, float *lux)
 Ambient 22 read lux function.
 
uint8_t ambient22_get_int_pin (ambient22_t *ctx)
 Ambient 22 get int pin function.
 

Detailed Description

This file contains API for Ambient 22 Click Driver.

Enumeration Type Documentation

◆ ambient22_return_value_t

Ambient 22 Click return value data.

Predefined enum values for driver return values.

Enumerator
AMBIENT22_OK 
AMBIENT22_ERROR