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_i2c_master.h"
73#define AMBIENT23_REG_CONFIG 0x00
74#define AMBIENT23_REG_WHITE_DATA 0x04
75#define AMBIENT23_REG_ALS_DATA 0x05
76#define AMBIENT23_REG_DEVICE_ID 0x09
94#define AMBIENT23_GAIN_1 0x0000u
95#define AMBIENT23_GAIN_2 0x0800u
96#define AMBIENT23_GAIN_4 0x1800u
97#define AMBIENT23_GAIN_MSK 0x1800u
103#define AMBIENT23_DATA_GAIN_1 0x0000u
104#define AMBIENT23_DATA_GAIN_2 0x2000u
105#define AMBIENT23_DATA_GAIN_MASK 0x2000u
111#define AMBIENT23_SDO_SHUTDOWN_ON 0x8000u
112#define AMBIENT23_SDO_SHUTDOWN_OFF 0x0000u
113#define AMBIENT23_SHUTDOWN_ON 0x0001u
114#define AMBIENT23_SHUTDOWN_OFF 0x0000u
120#define AMBIENT23_TRIGGER_ON 0x0004u
121#define AMBIENT23_TRIGGER_OFF 0x0000u
127#define AMBIENT23_AUTO_FORCE_MODE 0x0800u
128#define AMBIENT23_MANUAL_FORCE_MODE 0x0000u
134#define AMBIENT23_INTEGRATION_50_MS 0x0000u
135#define AMBIENT23_INTEGRATION_100_MS 0x0010u
136#define AMBIENT23_INTEGRATION_200_MS 0x0020u
137#define AMBIENT23_INTEGRATION_400_MS 0x0030u
138#define AMBIENT23_INTEGRATION_800_MS 0x0040u
139#define AMBIENT23_INTEGRATION_TIME_MSK 0x0070u
145#define AMBIENT23_CONFIG_DEF_VAL 0x0100u
151#define AMBIENT23_PART_ID 0x35
157#define AMBIENT23_TYPICAL_RESOLUTION 0.27264f
164#define AMBIENT23_DEVICE_ADDRESS 0x10
182#define AMBIENT23_MAP_MIKROBUS( cfg, mikrobus ) \
183 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
184 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
ambient23_return_value_t
Ambient 23 Click return value data.
Definition ambient23.h:222
@ AMBIENT23_ERROR
Definition ambient23.h:224
@ AMBIENT23_OK
Definition ambient23.h:223
void ambient23_cfg_setup(ambient23_cfg_t *cfg)
Ambient 23 configuration object setup function.
err_t ambient23_read_light_data(ambient23_t *ctx, float *light_data)
Ambient 23 get light data function.
err_t ambient23_generic_read(ambient23_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Ambient 23 I2C reading function.
err_t ambient23_reg_write(ambient23_t *ctx, uint8_t reg, uint16_t data_in)
Ambient 23 register data writing function.
err_t ambient23_reg_read(ambient23_t *ctx, uint8_t reg, uint16_t *data_out)
Ambient 23 register reading function.
err_t ambient23_calculate_res(ambient23_t *ctx, float *conversion_mul)
Ambient 23 get conversion data function.
err_t ambient23_generic_write(ambient23_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Ambient 23 I2C writing function.
err_t ambient23_init(ambient23_t *ctx, ambient23_cfg_t *cfg)
Ambient 23 initialization function.
err_t ambient23_default_cfg(ambient23_t *ctx)
Ambient 23 default configuration function.
Ambient 23 Click configuration object.
Definition ambient23.h:208
uint32_t i2c_speed
Definition ambient23.h:212
pin_name_t scl
Definition ambient23.h:209
pin_name_t sda
Definition ambient23.h:210
uint8_t i2c_address
Definition ambient23.h:213
Ambient 23 Click context object.
Definition ambient23.h:194
i2c_master_t i2c
Definition ambient23.h:196
uint8_t slave_address
Definition ambient23.h:199