Loading...
Searching...
No Matches
isl29020.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
22
23#include <stdint.h>
24#include "periph/i2c.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
42#ifndef CONFIG_ISL29020_DEFAULT_ADDRESS
43#define CONFIG_ISL29020_DEFAULT_ADDRESS 0x44
44#endif
46
54
64
74
78typedef struct {
80 float lux_fac;
82
93
102int isl29020_read(const isl29020_t *dev);
103
113
123
124#ifdef __cplusplus
125}
126#endif
127
int isl29020_init(isl29020_t *dev, const isl29020_params_t *params)
Initialize a new ISL29020 device.
isl29020_mode_t
Possible modes for the ISL29020 sensor.
Definition isl29020.h:50
int isl29020_disable(const isl29020_t *dev)
Disable the given sensor.
int isl29020_enable(const isl29020_t *dev)
Enable the given sensor.
int isl29020_read(const isl29020_t *dev)
Read a lighting value from the sensor, the result is given in lux.
isl29020_range_t
Possible range values for the ISL29020 sensor.
Definition isl29020.h:58
@ ISL29020_MODE_AMBIENT
set sensor to detect ambient light
Definition isl29020.h:51
@ ISL29020_MODE_IR
set sensor to detect infrared light
Definition isl29020.h:52
@ ISL29020_RANGE_64K
set range to 0-64000 lux
Definition isl29020.h:62
@ ISL29020_RANGE_16K
set range to 0-16000 lux
Definition isl29020.h:61
@ ISL29020_RANGE_1K
set range to 0-1000 lux
Definition isl29020.h:59
@ ISL29020_RANGE_4K
set range to 0-4000 lux
Definition isl29020.h:60
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition i2c.h:155
Low-level I2C peripheral driver interface definition.
Data structure holding the full set of configuration parameters.
Definition isl29020.h:68
isl29020_range_t range
range setting to use
Definition isl29020.h:71
uint8_t addr
address on that bus
Definition isl29020.h:70
isl29020_mode_t mode
measurement mode to use
Definition isl29020.h:72
i2c_t i2c
I2C bus the device is connected to.
Definition isl29020.h:69
Device descriptor for ISL29020 sensors.
Definition isl29020.h:78
isl29020_params_t params
device initialization parameters
Definition isl29020.h:79
float lux_fac
factor to calculate actual lux value
Definition isl29020.h:80