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