57#define OPT3001_CONVERSION_TIME_100_MS (0x0000)
58#define OPT3001_CONVERSION_TIME_800_MS (0x0800)
72#ifndef CONFIG_OPT3001_I2C_ADDRESS
73#define CONFIG_OPT3001_I2C_ADDRESS (0x45)
82#if IS_ACTIVE(CONFIG_OPT3001_CONVERSION_TIME_100)
83#define CONFIG_OPT3001_CONVERSION_TIME OPT3001_CONVERSION_TIME_100_MS
84#elif IS_ACTIVE(CONFIG_OPT3001_CONVERSION_TIME_800)
85#define CONFIG_OPT3001_CONVERSION_TIME OPT3001_CONVERSION_TIME_800_MS
88#ifndef CONFIG_OPT3001_CONVERSION_TIME
89#define CONFIG_OPT3001_CONVERSION_TIME OPT3001_CONVERSION_TIME_800_MS
int opt3001_set_active(const opt3001_t *dev)
Set active mode, this enables periodic measurements.
int opt3001_read_lux(const opt3001_t *dev, uint32_t *convl)
Read sensor's raw data and convert it to milliLux.
int opt3001_init(opt3001_t *dev, const opt3001_params_t *params)
Initialize the OPT3001 sensor driver.
int opt3001_reset(const opt3001_t *dev)
Reset the OPT3001 sensor while simultaneous deactivating measurements.
@ OPT3001_OK
Success, no error.
@ OPT3001_ERROR_DEV
Internal device error.
@ OPT3001_ERROR_BUS
I2C bus error.
@ OPT3001_ERROR
General error.
uint_fast8_t i2c_t
Default i2c_t type definition.
Low-level I2C peripheral driver interface definition.
Common macros and compiler attributes/pragmas configuration.
Parameters needed for device initialization.
i2c_t i2c_dev
I2C device, the sensor is connected to.
uint8_t i2c_addr
The sensor's slave address on the I2C bus.
Device descriptor for OPT3001 sensors.
opt3001_params_t params
Configuration parameters.