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)
43 #define BH1750FVI_DEFAULT_ADDR BH1750FVI_ADDR_PIN_HIGH
44 
48 #define BH1750FVI_I2C_MAX_CLK I2C_SPEED_FAST
49 
53 enum {
56 };
57 
61 typedef struct {
63  uint8_t addr;
64 } bh1750fvi_t;
65 
69 typedef struct {
71  uint8_t addr;
74 
85 
97 uint16_t bh1750fvi_sample(const bh1750fvi_t *dev);
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif /* BH1750FVI_H */
104 
uint8_t addr
slave address of the device
Definition: bh1750fvi.h:63
uint8_t addr
slave address of the device
Definition: bh1750fvi.h:71
i2c_speed_t clk
clock speed to use on the I2C bus
Definition: bh1750fvi.h:72
unsigned int i2c_t
Default i2c_t type definition.
Definition: i2c.h:108
everything was fine
Definition: bh1750fvi.h:54
int bh1750fvi_init(bh1750fvi_t *dev, bh1750fvi_params_t *params)
Initialize the given BH1750FVI device.
error initializing the I2C bus
Definition: bh1750fvi.h:55
i2c_t i2c
I2C bus the device is connected to.
Definition: bh1750fvi.h:62
Set of configuration parameters for BH1750FV devices.
Definition: bh1750fvi.h:69
Device descriptor for BH1570FVI devices.
Definition: bh1750fvi.h:61
i2c_t i2c
I2C bus the device is connected to.
Definition: bh1750fvi.h:70
uint16_t bh1750fvi_sample(const bh1750fvi_t *dev)
Read a ambient light value from the given device [in LUX].
Low-level I2C peripheral driver interface definition.