39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_analog_in.h"
52#include "drv_i2c_master.h"
75#define AMBIENT10_SET_DEV_ADDR 0x4D
81#define AMBIENT10_ADC_RESOLUTION 0x0FFF
82#define AMBIENT10_VREF_3V3 3.3
83#define AMBIENT10_VREF_5V 5.0
90#define AMBIENT10_MICROAMPER_TO_AMPER 0.000001
91#define AMBIENT10_IOUT_TO_LUX 2.5
92#define AMBIENT10_IOUT_RESISTOR 5100
110#define AMBIENT10_MAP_MIKROBUS( cfg, mikrobus ) \
111 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
112 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
113 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
ambient10_return_value_t
Ambient 10 Click return value data.
Definition ambient10.h:155
@ AMBIENT10_ERROR
Definition ambient10.h:157
@ AMBIENT10_OK
Definition ambient10.h:156
err_t ambient10_set_vref(ambient10_t *ctx, float vref)
Ambient 10 set vref function.
err_t ambient10_read_raw_adc(ambient10_t *ctx, uint16_t *raw_adc)
Ambient 10 read raw ADC function.
uint16_t ambient10_voltage_to_lux(ambient10_t *ctx, float voltage)
Ambient 10 voltage to illuminance function.
err_t ambient10_init(ambient10_t *ctx, ambient10_cfg_t *cfg)
Ambient 10 initialization function.
void ambient10_cfg_setup(ambient10_cfg_t *cfg)
Ambient 10 configuration object setup function.
err_t ambient10_read_an_pin_value(ambient10_t *ctx, uint16_t *data_out)
Ambient 10 read AN pin value function.
err_t ambient10_read_adc_voltage(ambient10_t *ctx, float *voltage)
Ambient 10 read ADC voltage function.
err_t ambient10_read_an_pin_voltage(ambient10_t *ctx, float *data_out)
Ambient 10 read AN pin voltage level function.
Ambient 10 Click configuration object.
Definition ambient10.h:137
analog_in_resolution_t resolution
Definition ambient10.h:145
float vref
Definition ambient10.h:146
uint32_t i2c_speed
Definition ambient10.h:142
pin_name_t scl
Definition ambient10.h:139
pin_name_t sda
Definition ambient10.h:140
pin_name_t an
Definition ambient10.h:138
uint8_t i2c_address
Definition ambient10.h:143
Ambient 10 Click context object.
Definition ambient10.h:123
float vref
Definition ambient10.h:128
i2c_master_t i2c
Definition ambient10.h:125
uint8_t slave_address
Definition ambient10.h:127
analog_in_t adc
Definition ambient10.h:124