BMP180.C文件
#include "N76E003.h"
#include "Common.h"
#include "Delay.h"
#include "SFR_Macro.h"
#include "Function_define.h"
#include "bmp180.h"
#include <math.h> //Keil library
#include <stdlib.h> //Keil library
#include <stdio.h> //Keil library
#include <INTRINS.H> //Keil library
#define uchar unsigned char
#define uint unsigned int
#define BMP085_SlaveAddress 0xee //定义器件在IIC总线中的从地址
#define OSS 0 // Oversampling Setting (note: code is not set up to use other OSS values)
long temperature;//温度值
long pressure; //压力值
long height; //相对海拔高度值
int dis_data;
short ac1;
short ac2;
short ac3;
unsigned short ac4;
unsigned short ac5;
unsigned short ac6;
short b1;
short b2;
short mb;
short mc;
short md;
void Delay5us() //5us延时(不怎么准)
{
nop;
nop; nop; nop; nop; nop; nop; nop; nop;
nop;
nop; nop; nop; nop; nop; nop; nop; nop;
nop;
nop; nop; nop; nop; nop; nop; nop; nop;
nop;
nop; nop; nop; nop; nop; nop; nop; nop;
nop;
nop; nop; nop; nop; nop; nop; nop; nop;
}
/**************************************
起始信号
**************************************/
void BMP085_Start()
{
SDA = 1; //拉高数据线
SCL = 1; //拉高时钟线
Delay5us(); //延时
SDA = 0; //产生下降沿
Delay5us(); /