The friendly Operating System for the Internet of Things
bh1750fvi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 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 
21 #ifndef BH1750FVI_H
22 #define BH1750FVI_H
23 
24 #include "periph/i2c.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
36 #define BH1750FVI_ADDR_PIN_LOW (0x5c)
37 #define BH1750FVI_ADDR_PIN_HIGH (0x23)
44 #define BH1750FVI_DEFAULT_ADDR BH1750FVI_ADDR_PIN_HIGH
45 
49 #define BH1750FVI_I2C_MAX_CLK I2C_SPEED_FAST
50 
54 enum {
57 };
58 
62 typedef struct {
64  uint8_t addr;
65 } bh1750fvi_t;
66 
70 typedef struct {
72  uint8_t addr;
75 
86 
98 uint16_t bh1750fvi_sample(bh1750fvi_t *dev);
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif /* BH1750FVI_H */
105 
uint8_t addr
slave address of the device
Definition: bh1750fvi.h:64
uint8_t addr
slave address of the device
Definition: bh1750fvi.h:72
i2c_speed_t clk
clock speed to use on the I2C bus
Definition: bh1750fvi.h:73
unsigned int i2c_t
Default i2c_t type definition.
Definition: i2c.h:104
int bh1750fvi_init(bh1750fvi_t *dev, bh1750fvi_params_t *params)
Initialize the given BH1750FVI device.
everything was fine
Definition: bh1750fvi.h:55
uint16_t bh1750fvi_sample(bh1750fvi_t *dev)
Read a ambient light value from the given device [in LUX].
error initializing the I2C bus
Definition: bh1750fvi.h:56
i2c_t i2c
I2C bus the device is connected to.
Definition: bh1750fvi.h:63
Set of configuration parameters for BH1750FV devices.
Definition: bh1750fvi.h:70
Device descriptor for BH1570FVI devices.
Definition: bh1750fvi.h:62
i2c_t i2c
I2C bus the device is connected to.
Definition: bh1750fvi.h:71
Low-level I2C peripheral driver interface definition.