#include
#include "bmp280111.h"
#include //Keil library
#include //Keil library
#include //Keil library
#include //Keil library
#include "sensor_am21xx.h"
#define uchar unsigned char
#define uint unsigned int
#define BMP280_SlaveAddress 0xec //定义器件在IIC总线中的从地址
#define OSS 0 // Oversampling Setting (note: code is not set up to use other OSS values)
unsigned short dig_T1;
short dig_T2;
short dig_T3;
unsigned short dig_P1;
short dig_P2;
short dig_P3;
short dig_P4;
short dig_P5;
short dig_P6;
short dig_P7;
short dig_P8;
short dig_P9;
void delay() //略微延时 6us约>4.7us
{
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
}
void iic_start() //启动信号
{
SDA=1;
SCL=1;
delay();
SDA=0;
delay();
SCL=0;
}
void iic_stop() //停止信号
{
SDA=0;
SCL=1;
delay();
SDA=1;
delay();
SCL=0;
}
void iic_ack() //应答信号
{
uchar i=0;
SCL=1;
delay();
while((SDA==1)&&(i<255))
i++;
SCL=0;
delay();
}
void iic_send_byte(uchar bat)