ambient12 2.0.0.0
ambient12.h File Reference

This file contains API for Ambient 12 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_analog_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  ambient12_t
 Ambient 12 Click context object. More...
 
struct  ambient12_cfg_t
 Ambient 12 Click configuration object. More...
 

Macros

#define AMBIENT12_SET_DEV_ADDR   0x4D
 Ambient 12 device address setting.
 
#define AMBIENT12_ADC_RESOLUTION   0x0FFF
 Ambient 12 ADC setting.
 
#define AMBIENT12_VREF_3V3   3.3
 
#define AMBIENT12_IOUT_CURRENT_H_GAIN   0.57
 Ambient 12 ambient light constants.
 
#define AMBIENT12_IOUT_CURRENT_M_GAIN   0.057
 
#define AMBIENT12_IOUT_CURRENT_L_GAIN   0.0057
 
#define AMBIENT12_MICROAMPER_TO_AMPER   0.000001
 
#define AMBIENT12_IOUT_RESISTOR   5700
 
#define AMBIENT12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  ambient12_gain_mode_t { AMBIENT12_MODE_SHUTDOWN , AMBIENT12_MODE_H_GAIN , AMBIENT12_MODE_M_GAIN , AMBIENT12_MODE_L_GAIN }
 Ambient 12 Click gain mode setting. More...
 
enum  ambient12_return_value_t { AMBIENT12_OK = 0 , AMBIENT12_ERROR = -1 }
 Ambient 12 Click return value data. More...
 

Functions

void ambient12_cfg_setup (ambient12_cfg_t *cfg)
 Ambient 12 configuration object setup function.
 
err_t ambient12_init (ambient12_t *ctx, ambient12_cfg_t *cfg)
 Ambient 12 initialization function.
 
err_t ambient12_read_an_pin_value (ambient12_t *ctx, uint16_t *data_out)
 Ambient 12 read AN pin value function.
 
err_t ambient12_read_an_pin_voltage (ambient12_t *ctx, float *data_out)
 Ambient 12 read AN pin voltage level function.
 
err_t ambient12_read_raw_adc (ambient12_t *ctx, uint16_t *raw_adc)
 Ambient 12 read raw ADC function.
 
err_t ambient12_read_adc_voltage (ambient12_t *ctx, float *voltage)
 Ambient 12 read ADC voltage function.
 
void ambient12_set_gc1_pin (ambient12_t *ctx, uint8_t state)
 Ambient 12 set GC1 pin state function.
 
void ambient12_set_gc2_pin (ambient12_t *ctx, uint8_t state)
 Ambient 12 set GC2 pin state function.
 
void ambient12_set_gain_mode (ambient12_t *ctx, uint8_t mode)
 Ambient 12 set gain mode function.
 
int32_t ambient12_voltage_to_lux (ambient12_t *ctx, float voltage)
 Ambient 12 voltage to illuminance function.
 

Detailed Description

This file contains API for Ambient 12 Click Driver.

Enumeration Type Documentation

◆ ambient12_gain_mode_t

Ambient 12 Click gain mode setting.

Predefined enum values for gain mode values.

Enumerator
AMBIENT12_MODE_SHUTDOWN 
AMBIENT12_MODE_H_GAIN 
AMBIENT12_MODE_M_GAIN 
AMBIENT12_MODE_L_GAIN 

◆ ambient12_return_value_t

Ambient 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
AMBIENT12_OK 
AMBIENT12_ERROR