Files
TencentOS-tiny/board/BearPi_STM32L562RE/BSP/Hardware/BH1750/bh1750.h
supowang 13d5ea043a add BearPi L5 support
add BearPi L5 support
2021-03-15 14:32:11 +08:00

40 lines
1003 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef __BH1750_H__
#define __BH1750_H__
/* 包含头文件 ----------------------------------------------------------------*/
#include "stm32l4xx_hal.h"
/* 类型定义 ------------------------------------------------------------------*/
/* 宏定义 --------------------------------------------------------------------*/
#define I2C_OWN_ADDRESS 0x0A
#define BH1750_Addr 0x46
#define BH1750_ON 0x01
#define BH1750_CON 0x10
#define BH1750_ONE 0x20
#define BH1750_RSET 0x07
/***************************************************************
* 函数名称: BH1750_Data_TypeDef
* 说 明: BH1750结构体
* 参 数: 无
* 返 回 值: 无
***************************************************************/
typedef struct
{
char Lux[5]; //光强
}BH1750_Data_TypeDef;
void BH1750_Init(void); //IO初始化
void BH1750_Start(void); //上电,设置清除数据寄存器
//void BH1750_Read(void); //连续的读取内部寄存器数据
float BH1750_Convert(void);
#endif