isl29020.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
24 #ifndef ISL29020_H
25 #define ISL29020_H
26 
27 #include <stdint.h>
28 #include "periph/i2c.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
37 #define ISL29020_DEFAULT_ADDRESS 0x44
38 
42 typedef enum {
46 
50 typedef enum {
56 
60 typedef struct {
62  uint8_t addr;
66 
70 typedef struct {
72  float lux_fac;
73 } isl29020_t;
74 
84 int isl29020_init(isl29020_t *dev, const isl29020_params_t *params);
85 
94 int isl29020_read(const isl29020_t *dev);
95 
104 int isl29020_enable(const isl29020_t *dev);
105 
114 int isl29020_disable(const isl29020_t *dev);
115 
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif /* ISL29020_H */
121 
set range to 0-1000 lux
Definition: isl29020.h:51
i2c_t i2c
I2C bus the device is connected to.
Definition: isl29020.h:61
int isl29020_disable(const isl29020_t *dev)
Disable the given sensor.
int isl29020_init(isl29020_t *dev, const isl29020_params_t *params)
Initialize a new ISL29020 device.
int isl29020_enable(const isl29020_t *dev)
Enable the given sensor.
isl29020_mode_t
Possible modes for the ISL29020 sensor.
Definition: isl29020.h:42
isl29020_params_t params
device initialization parameters
Definition: isl29020.h:71
isl29020_range_t
Possible range values for the ISL29020 sensor.
Definition: isl29020.h:50
unsigned int i2c_t
Default i2c_t type definition.
Definition: i2c.h:157
set range to 0-16000 lux
Definition: isl29020.h:53
set sensor to detect ambient light
Definition: isl29020.h:43
Device descriptor for ISL29020 sensors.
Definition: isl29020.h:70
Data structure holding the full set of configuration parameters.
Definition: isl29020.h:60
set sensor to detect infrared light
Definition: isl29020.h:44
int isl29020_read(const isl29020_t *dev)
Read a lighting value from the sensor, the result is given in lux.
uint8_t addr
address on that bus
Definition: isl29020.h:62
float lux_fac
factor to calculate actual lux value
Definition: isl29020.h:72
set range to 0-64000 lux
Definition: isl29020.h:54
isl29020_mode_t mode
measurement mode to use
Definition: isl29020.h:64
isl29020_range_t range
range setting to use
Definition: isl29020.h:63
set range to 0-4000 lux
Definition: isl29020.h:52
Low-level I2C peripheral driver interface definition.