409#define VL6180X_I2C_ADDR (0x29)
513#if IS_USED(MODULE_VL6180X_RNG) || DOXYGEN
516#if IS_USED(MODULE_VL6180X_ALS) || DOXYGEN
536#if IS_USED(MODULE_VL6180X_RNG) || DOXYGEN
540#if IS_USED(MODULE_VL6180X_ALS) || DOXYGEN
557#if IS_USED(MODULE_VL6180X_SHUTDOWN) || DOXYGEN
561#if IS_USED(MODULE_VL6180X_IRQ) || DOXYGEN
590#if IS_USED(MODULE_VL6180X_RNG) || DOXYGEN
601#if IS_USED(MODULE_VL6180X_ALS) || DOXYGEN
625#if IS_USED(MODULE_VL6180X_RNG) || DOXYGEN
628#if IS_USED(MODULE_VL6180X_ALS) || DOXYGEN
697#if IS_USED(MODULE_VL6180X_RNG) || DOXYGEN
762#if IS_USED(MODULE_VL6180X_CONFIG) || DOXYGEN
798#if IS_USED(MODULE_VL6180X_ALS) || DOXYGEN
872#if IS_USED(MODULE_VL6180X_CONFIG) || DOXYGEN
910#if IS_USED(MODULE_VL6180X_SHUTDOWN) || DOXYGEN
947#if IS_USED(MODULE_VL6180X_IRQ) || DOXYGEN
1006#if IS_USED(MODULE_VL6180X_CONFIG) || DOXYGEN
1049 uint16_t reg,
const uint8_t *data, uint8_t len);
1069 uint16_t reg, uint8_t *data, uint8_t len);
Low-level GPIO peripheral driver interface definitions.
int vl6180x_rng_read(vl6180x_t *dev, uint8_t *mm)
Read one ranging data sample in mm.
vl6180x_rng_status_t vl6180x_rng_status(const vl6180x_t *dev)
Get status of last range measurement.
int vl6180x_int_enable(vl6180x_t *dev, vl6180x_int_config_t mode)
Enable and disable interrupts.
int vl6180x_reg_read(const vl6180x_t *dev, uint16_t reg, uint8_t *data, uint8_t len)
Direct read from register.
vl6180x_als_status_t
Ambient light sensing (ALS) status.
int vl6180x_int_config(vl6180x_t *dev, vl6180x_int_thresh_t thresh)
Configure thresholds for event interrupts at runtime.
int vl6180x_start_cont(vl6180x_t *dev)
Start measurements in continuous mode.
int vl6180x_als_data_ready(const vl6180x_t *dev)
ALS data ready status function.
vl6180x_als_status_t vl6180x_als_status(const vl6180x_t *dev)
Get status of last ALS measurement.
int vl6180x_stop_cont(vl6180x_t *dev)
Stop measurements in continuous mode.
int vl6180x_als_read(vl6180x_t *dev, uint16_t *raw, uint16_t *lux)
Read one ambient light sensing (ALS) data sample.
int vl6180x_int_wait(const vl6180x_t *dev, vl6180x_int_config_t *src)
Wait for configured interrupts and return the interrupt sources.
int vl6180x_power_up(vl6180x_t *dev)
Power down the sensor.
int vl6180x_als_start_single(const vl6180x_t *dev)
Start a single-shot ALS measurement.
vl6180x_int_mode_t
Interrupt mode.
int vl6180x_rng_config(vl6180x_t *dev, uint8_t period, uint8_t max_time)
Reconfigure range measurements at runtime.
int vl6180x_rng_start_single(const vl6180x_t *dev)
Start a single-shot range measurement.
vl6180x_als_gain_t
Analogue gain for ALS measurements.
int vl6180x_reg_write(const vl6180x_t *dev, uint16_t reg, const uint8_t *data, uint8_t len)
Direct write to register.
int vl6180x_rng_data_ready(const vl6180x_t *dev)
Range data ready status function.
int vl6180x_init(vl6180x_t *dev, const vl6180x_params_t *params)
Initialize the VL6180X sensor device.
vl6180x_error_t
Error codes.
int vl6180x_als_config(vl6180x_t *dev, uint8_t period, uint8_t int_time, vl6180x_als_gain_t gain)
Reconfigure ambient light sensing (ALS) during runtime.
vl6180x_rng_status_t
Range measurement status.
int vl6180x_power_down(const vl6180x_t *dev)
Power down the sensor.
@ VL6180X_ALS_OVERFLOW
ALS measurement overflow.
@ VL6180X_ALS_UNDERFLOW
ALS measurement underflow.
@ VL6180X_ALS_OK
No error.
@ VL6180X_INT_LOW
Interrupt is triggered when values are below the lower threshold.
@ VL6180X_INT_DRDY
Interrupt is triggered when new data are ready to be read.
@ VL6180X_INT_HIGH
Interrupt is triggered when values are above the upper threshold.
@ VL6180X_INT_NONE
Interrupt is disabled.
@ VL6180X_INT_OUT
Interrupt is triggered when values are below the lower threshold or above the upper threshold (value ...
@ VL6180X_ALS_GAIN_5
5 x gain (actual analogue gain of 5.21)
@ VL6180X_ALS_GAIN_2_5
2.5 x gain (actual analogue gain of 2.6)
@ VL6180X_ALS_GAIN_1
1 x gain (actual analogue gain of 1.01), default
@ VL6180X_ALS_GAIN_1_67
1.67 x gain (actual analogue gain of 1.72)
@ VL6180X_ALS_GAIN_40
40 x gain (actual analogue gain of 40)
@ VL6180X_ALS_GAIN_20
20 x gain (actual analogue gain of 20)
@ VL6180X_ALS_GAIN_10
10 x gain (actual analogue gain of 10.32)
@ VL6180X_ALS_GAIN_1_25
1.25 x gain (actual analogue gain of 1.28)
@ VL6180X_ERROR_NOT_READY
Device not ready.
@ VL6180X_ERROR_NO_DATA
No data available.
@ VL6180X_ERROR_WRONG_ID
Wrong id read.
@ VL6180X_ERROR_ALS
Ambient light sensing (ALS) error.
@ VL6180X_ERROR_RNG
Ranging error.
@ VL6180X_ERROR_NO_PIN
Pin not defined.
@ VL6180X_ERROR_I2C
I2C communication error.
@ VL6180X_RNG_ALGO_UNDERFLOW
Ranging algorithm underflow.
@ VL6180X_RNG_EARLY_CONV_EST
Early convergence estimate.
@ VL6180X_RNG_ALGO_OVERFLOW
Ranging algorithm overflow.
@ VL6180X_RNG_NO_TARGET
No target, ignore.
@ VL6180X_RNG_RAW_ALGO_OVERFLOW
Raw ranging algorithn overflow.
@ VL6180X_RNG_VCSEL_WD_TEST
VCSEL watchdog test.
@ VL6180X_RNG_PLL1_LOCK
PLL1 lock.
@ VL6180X_RNG_MAX_CONV
Maximum convergence time reached.
@ VL6180X_RNG_MAX_SNR
Maximum SNR reached.
@ VL6180X_RNG_VCSEL_CONT_TEST
VCSEL continuity Test.
@ VL6180X_RNG_PLL2_LOCK
PLL2 lock.
@ VL6180X_RNG_VCSEL_WD
VCSEL watchdog.
@ VL6180X_RNG_OK
No error.
@ VL6180X_RNG_RAW_ALGO_UNDERFLOW
Raw ranging algorithm underflow.
Low-level I2C peripheral driver interface definition.
vl6180x_int_mode_t als_int
Interrupt mode for ALS measurements.
vl6180x_int_mode_t rng_int
Interrupt mode for range measurements.
Interrupt threshold configuration.
uint8_t rng_high
upper threshold for range values
uint8_t rng_low
lower threshold for range values
uint16_t als_high
upper threshold for ALS values
uint16_t als_low
lower threshold for ALS values
VL6180X device configuration.
uint16_t als_int_time
ALS integration time in ms [1...512] (default 100 = 100 ms, recommended)
gpio_t shutdown_pin
Shutdown pin, LOW active.
uint8_t rng_max_time
Maximum convergence time in ms [1...63] given to the sensor to perform a range measurement (default 5...
vl6180x_int_config_t int_cfg
Interrupt mode configuration.
uint16_t als_lux_res
ALS lux resolution multiplied by factor 1000 (default 0.32 lux/count is the factory calibrated lux re...
uint8_t i2c_addr
I2C slave address.
uint8_t period
Measurement period in continuous mode in steps of 10 ms (default 20 = 200 ms).
vl6180x_als_gain_t als_gain
ALS analogue gain for light channel (default VL6180X_ALS_GAIN_1_0)
vl6180x_int_thresh_t int_thresh
Interrupt threshold configuration.
gpio_t int_pin
Interrupt pin, LOW active.
unsigned i2c_dev
I2C device, default I2C_DEV(0)
VL6180X sensor device data structure type.
vl6180x_als_status_t als_status
Status of last ALS measurement.
vl6180x_rng_status_t rng_status
Status of last range measurement.
vl6180x_params_t params
Device initialization parameters.
bool cont_meas
Continuous mode running.
Register definitions for ST VL6180X Ranging and Ambient Light Sensing (ALS) module.