You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#ifndef __bh1750_H
|
|
|
|
|
#define __bh1750_H
|
|
|
|
|
|
|
|
|
|
#include "myiic1.h"
|
|
|
|
|
#include "delay.h"
|
|
|
|
|
|
|
|
|
|
#define ADDR 0x23//0100011
|
|
|
|
|
#define BHAddWrite 0x46 //<EFBFBD>ӻ<EFBFBD><EFBFBD><EFBFBD>ַ+<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
|
|
|
|
#define BHAddRead 0x47 //<EFBFBD>ӻ<EFBFBD><EFBFBD><EFBFBD>ַ+<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
|
|
|
|
#define BHPowDown 0x00 //<EFBFBD>ر<EFBFBD>ģ<EFBFBD><EFBFBD>
|
|
|
|
|
#define BHPowOn 0x01 //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>
|
|
|
|
|
#define BHReset 0x07 //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼĴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>poweronģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч
|
|
|
|
|
#define BHModeH1 0x10 //<EFBFBD>߷ֱ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>λ1lx <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>120ms
|
|
|
|
|
#define BHModeH2 0x11 //<EFBFBD>߷ֱ<EFBFBD><EFBFBD><EFBFBD>2 <EFBFBD><EFBFBD>λ0.5lx <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>120ms
|
|
|
|
|
#define BHModeL 0x13 //<EFBFBD>ͷֱ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>λ4lx <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>16ms
|
|
|
|
|
#define BHSigModeH 0x20 //һ<EFBFBD>θ߷ֱ<EFBFBD><EFBFBD>ʲ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>powerdownģʽ
|
|
|
|
|
#define BHSigModeH2 0x21 //ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
#define BHSigModeL 0x23 // ͬ<EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
void Single_Write_BH1750(unsigned char REG_Address);
|
|
|
|
|
void Init_BH1750(void);
|
|
|
|
|
void bh_data_send(u8 command);
|
|
|
|
|
u16 bh_data_read(void);
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|