32#ifndef __VEML7700_SENSOR_H__
33#define __VEML7700_SENSOR_H__
62#define VEML7700_I2C_ADDR (0x10)
68#define VEML7700_INTEGRATION_TIME_25MS (0b1100)
69#define VEML7700_INTEGRATION_TIME_50MS (0b1000)
70#define VEML7700_INTEGRATION_TIME_100MS (0b0000)
71#define VEML7700_INTEGRATION_TIME_200MS (0b0001)
72#define VEML7700_INTEGRATION_TIME_400MS (0b0010)
73#define VEML7700_INTEGRATION_TIME_800MS (0b0011)
80#define VEML7700_GAIN_1 (0b00)
81#define VEML7700_GAIN_2 (0b01)
82#define VEML7700_GAIN_DIV_8 (0b10)
83#define VEML7700_GAIN_DIV_4 (0b11)
90#define VEML7700_POWER_SAVING_MODE_500MS (0b00)
91#define VEML7700_POWER_SAVING_MODE_1000MS (0b01)
92#define VEML7700_POWER_SAVING_MODE_2000MS (0b10)
93#define VEML7700_POWER_SAVING_MODE_4000MS (0b11)
100#define VEML7700_PERSISTENCE_PROTECTION_1 (0b00)
101#define VEML7700_PERSISTENCE_PROTECTION_2 (0b01)
102#define VEML7700_PERSISTENCE_PROTECTION_4 (0b10)
103#define VEML7700_PERSISTENCE_PROTECTION_8 (0b11)
uint8_t i2c_addr_t
Type for I²C addresses.
Definition bme280_sensor.h:54
uint16_t interrupt_enable
Enable/disable threshold interrupt.
Definition veml7700_sensor.h:129
uint16_t threshold_low
Low threshold for interrupt.
Definition veml7700_sensor.h:132
veml7700_config_t cfg
Sensor configuration.
Definition veml7700_sensor.h:143
uint16_t gain
Sensor sensitivity control.
Definition veml7700_sensor.h:126
uint16_t power_saving_enable
Enable/disable power saving mode.
Definition veml7700_sensor.h:134
i2c_bus_device_handle_t i2c_dev
I²C device handle.
Definition veml7700_sensor.h:141
uint16_t power_saving_mode
Power saving mode selection.
Definition veml7700_sensor.h:133
i2c_addr_t dev_addr
I²C address of the sensor.
Definition veml7700_sensor.h:142
uint16_t shutdown
Set to 1 to shutdown, 0 to wakeup.
Definition veml7700_sensor.h:130
uint16_t threshold_high
High threshold for interrupt.
Definition veml7700_sensor.h:131
uint16_t integration_time
Integration time setting.
Definition veml7700_sensor.h:127
uint16_t persistence_protect
Samples before interrupt triggers.
Definition veml7700_sensor.h:128
esp_err_t veml7700_i2c_probe(veml7700_handle_t sensor)
Probe if the sensor exist on the I²C bus.
Definition veml7700_sensor.c:259
uint8_t i2c_addr_t
Type for I²C addresses.
Definition veml7700_sensor.h:114
void veml7700_i2c_delete(veml7700_handle_t sensor)
Deinitialize the VEML7700 sensor and free resources.
Definition veml7700_sensor.c:246
void * veml7700_handle_t
Opaque handle for a VEML7700 sensor.
Definition veml7700_sensor.h:150
veml7700_handle_t veml7700_i2c_init(i2c_bus_handle_t bus, i2c_addr_t dev_addr)
Initialize the VEML7700 sensor over I²C.
Definition veml7700_sensor.c:197
veml7700_handle_t veml7700_i2c_create(i2c_bus_handle_t bus, i2c_addr_t dev_addr)
Create a VEML7700 device handle for I²C communication.
Definition veml7700_sensor.c:181
esp_err_t veml7700_i2c_write_config(veml7700_handle_t sensor, veml7700_config_t *cfg)
Write the configuration to the sensor.
Definition veml7700_sensor.c:273
esp_err_t veml7700_i2c_read_interrupt_status(veml7700_handle_t sensor, bool *low, bool *high)
Read the interrupt status from the sensor.
Definition veml7700_sensor.c:385
esp_err_t veml7700_i2c_read_white_channel(veml7700_handle_t sensor, ill_lx_t *val)
Read white channel value from the sensor.
Definition veml7700_sensor.c:370
esp_err_t veml7700_i2c_read_ambient_light(veml7700_handle_t sensor, ill_lx_t *val)
Read ambiant light value from the sensor.
Definition veml7700_sensor.c:354
uint32_t ill_lx_t
Type for illuminance [lx].
Definition veml7700_sensor.h:120
esp_err_t veml7700_i2c_read_config(veml7700_handle_t sensor, veml7700_config_t *cfg)
Read the sensor configuration.
Definition veml7700_sensor.c:315
Configuration structure for the VEML7700 sensor.
Definition veml7700_sensor.h:125
Device handle structure for the VEML7700 sensor.
Definition veml7700_sensor.h:140