-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbh1750.h
25 lines (17 loc) · 928 Bytes
/
bh1750.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* $Id$ */
#ifndef BH1750_H_XYZ
#define BH1750_H_XYZ
#define BH1750_POWER_ON 0x01
#define BH1750_RESET 0x07
#define BH1750_POWER_DOWN 0x00
#define BH1750_CONT_HR_MODE 0x10 /* Measurement at 1lx resolution, time 120ms */
#define BH1750_CONT_HR_MODE_2 0x11 /* Measurement at 0.5lx resolution, time 120ms */
#define BH1750_CONT_LR_MODE 0x13 /* Measurement at 4lx resolution, time is approx 16ms */
#define BH1750_ONE_TIME_HR_MODE 0x20 /* Measurement at 1lx resolution, time is approx 120ms */
#define BH1750_ONE_TIME_HR_MODE_2 0x21 /* Measurement at 0.5lx resolution, time is approx 120ms */
#define BH1750_ONE_TIME_LR_MODE 0x23 /* Measurement at 1lx resolution, time is approx 120ms. */
#define BH1750_ADDR 0x23
#define BH1750_RES_LEN 2
void bh_setup(uint32_t i2c, uint8_t addr);
uint16_t bh_read(uint32_t i2c, uint8_t addr, uint8_t mode);
#endif