ISL29020 light sensor¶
Device driver for the ISL29020 light sensor.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
-
enum
isl29020_mode_t¶ - ISL29020_MODE_AMBIENT
= 0 - set sensor to detect ambient light
- ISL29020_MODE_IR
= 1 - set sensor to detect infrared light
- ISL29020_MODE_AMBIENT
-
enum
isl29020_range_t¶ - ISL29020_RANGE_1K
= 0 - set range to 0-1000 lux
- ISL29020_RANGE_4K
= 1 - set range to 0-4000 lux
- ISL29020_RANGE_16K
= 2 - set range to 0-16000 lux
- ISL29020_RANGE_64K
= 3 - set range to 0-64000 lux
- ISL29020_RANGE_1K
-
int
isl29020_init(isl29020_t * dev, const isl29020_params_t * params)¶ Initialize a new ISL29020 device.
Parameters
dev: device descriptor of an ISL29020 device params: initialization parameters Return values
- 0 on success
- -1 on error
-
int
isl29020_read(const isl29020_t * dev)¶ Read a lighting value from the sensor, the result is given in lux.
Parameters
dev: device descriptor of an ISL29020 device Return values
- the measured brightness in lux
- -1 on error
-
int
isl29020_enable(const isl29020_t * dev)¶ Enable the given sensor.
Parameters
dev: device descriptor of an ISL29020 device Return values
- 0 on success
- -1 on error
-
int
isl29020_disable(const isl29020_t * dev)¶ Disable the given sensor.
Parameters
dev: device descriptor of an ISL29020 device Return values
- 0 on success
- -1 on error
-
ISL29020_DEFAULT_ADDRESS¶ The sensors default I2C address.
1
0x44
-
struct
isl29020_params_t¶ Data structure holding the full set of configuration parameters.
-
i2c.h::i2c_ti2c¶ I2C bus the device is connected to.
-
uint8_t
addr¶ address on that bus
-
isl29020.h::isl29020_range_trange¶ range setting to use
-
isl29020.h::isl29020_mode_tmode¶ measurement mode to use
-
-
struct
isl29020_t¶ Device descriptor for ISL29020 sensors.
-
isl29020_params_t
params¶ device initialization parameters
-
float
lux_fac¶ factor to calculate actual lux value
-
isl29020_params_t