Loading...
Searching...
No Matches
bh1750fvi.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
19
20#include "periph/i2c.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
32#define BH1750FVI_ADDR_PIN_LOW (0x23)
33#define BH1750FVI_ADDR_PIN_HIGH (0x5c)
35
39#define BH1750FVI_DEFAULT_ADDR BH1750FVI_ADDR_PIN_LOW
40
44#define BH1750FVI_I2C_MAX_CLK I2C_SPEED_FAST
45
49enum {
52};
53
57typedef struct {
59 uint8_t addr;
61
65typedef struct {
67 uint8_t addr;
69
80
92uint16_t bh1750fvi_sample(const bh1750fvi_t *dev);
93
94#ifdef __cplusplus
95}
96#endif
97
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:50
@ BH1750FVI_ERR_I2C
error initializing the I2C bus
Definition bh1750fvi.h:51
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition i2c.h:155
Low-level I2C peripheral driver interface definition.
Set of configuration parameters for BH1750FV devices.
Definition bh1750fvi.h:65
i2c_t i2c
I2C bus the device is connected to.
Definition bh1750fvi.h:66
uint8_t addr
slave address of the device
Definition bh1750fvi.h:67
Device descriptor for BH1570FVI devices.
Definition bh1750fvi.h:57
i2c_t i2c
I2C bus the device is connected to.
Definition bh1750fvi.h:58
uint8_t addr
slave address of the device
Definition bh1750fvi.h:59