/**
******************************************************************************
* @file
HTU20.x
* @brief
HTU20 function
* @cpu
STM32F051
* @compiler
KeiluVision V5.01
* @author
Hanney
* @copyright
* @version
V1.0.1
* @date
18-Sept-2015
* @modifydate20-Sept-2015
******************************************************************************
* @attention
*/
//STM32F051
模拟
IIC
//#include "boardAPI.h"
//#include "stm32f0xx.h"
//#include "HTU20.h"
//#include "uart.h"
//#include "delay.h"
#include "stm32f0xx.h"
#include "stm32lib.h"
#define
HTU20_CLK
RCC_AHBPeriph_GPIOB
#define
HTU20_SDA_PORT
GPIOB
#define
HTU20_SCL_PORT
GPIOB
#define
HTU20_SDA_PIN
GPIO_Pin_11
#define
HTU20_SCL_PIN
GPIO_Pin_10
#define
RESOLUTION_11b 0x81
//RH
11
TH
11
#define
RESOLUTION_12b 0x01
//RH
8
TH
12
#define
RESOLUTION_13b 0x80
//RH
10
TH
13
#define
RESOLUTION_14b 0x00
//RH
12
TH
14
#define
OTP_disEN
0x02
//
不能启动
OPT
加载
#define
OTP_EN
0x00
//
启动
OPT
加载
#define
RESh
16
//
湿度解析度
#define
RESt
16
//
温度解析度
#define
MeasureDelay
12
//
解析延时时间单位
ms
typedef
unsigned char
BYTE;
typedef
unsigned int
WORD;