Loading...
Searching...
No Matches
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
27extern "C" {
28#endif
29
36#define BH1750FVI_ADDR_PIN_LOW (0x23)
37#define BH1750FVI_ADDR_PIN_HIGH (0x5c)
43#define BH1750FVI_DEFAULT_ADDR BH1750FVI_ADDR_PIN_LOW
44
48#define BH1750FVI_I2C_MAX_CLK I2C_SPEED_FAST
49
53enum {
56};
57
61typedef struct {
63 uint8_t addr;
65
69typedef struct {
71 uint8_t addr;
73
84
96uint16_t bh1750fvi_sample(const bh1750fvi_t *dev);
97
98#ifdef __cplusplus
99}
100#endif
101
102#endif /* BH1750FVI_H */
uint16_t bh1750fvi_sample(const bh1750fvi_t *dev)
Read a ambient light value from the given device [in LUX].
int bh1750fvi_init(bh1750fvi_t *dev, const bh1750fvi_params_t *params)
Initialize the given BH1750FVI device.
@ BH1750FVI_OK
everything was fine
Definition bh1750fvi.h:54
@ BH1750FVI_ERR_I2C
error initializing the I2C bus
Definition bh1750fvi.h:55
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition i2c.h:151
Low-level I2C peripheral driver interface definition.
Set of configuration parameters for BH1750FV devices.
Definition bh1750fvi.h:69
i2c_t i2c
I2C bus the device is connected to.
Definition bh1750fvi.h:70
uint8_t addr
slave address of the device
Definition bh1750fvi.h:71
Device descriptor for BH1570FVI devices.
Definition bh1750fvi.h:61
i2c_t i2c
I2C bus the device is connected to.
Definition bh1750fvi.h:62
uint8_t addr
slave address of the device
Definition bh1750fvi.h:63