Subversion Repositories Code-Repo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
155 Kevin 1
#ifndef TEMP_BMP085_H
2
#define	TEMP_BMP085_H
3
 
4
#define BMP085_I2CADDR 0x77
5
 
6
#define BMP085_ULTRALOWPOWER    0
7
#define BMP085_STANDARD         1
8
#define BMP085_HIGHRES          2
9
#define BMP085_ULTRAHIGHRES     3
10
#define BMP085_CAL_AC1           0xAA  // R   Calibration data (16 bits)
11
#define BMP085_CAL_AC2           0xAC  // R   Calibration data (16 bits)
12
#define BMP085_CAL_AC3           0xAE  // R   Calibration data (16 bits)
13
#define BMP085_CAL_AC4           0xB0  // R   Calibration data (16 bits)
14
#define BMP085_CAL_AC5           0xB2  // R   Calibration data (16 bits)
15
#define BMP085_CAL_AC6           0xB4  // R   Calibration data (16 bits)
16
#define BMP085_CAL_B1            0xB6  // R   Calibration data (16 bits)
17
#define BMP085_CAL_B2            0xB8  // R   Calibration data (16 bits)
18
#define BMP085_CAL_MB            0xBA  // R   Calibration data (16 bits)
19
#define BMP085_CAL_MC            0xBC  // R   Calibration data (16 bits)
20
#define BMP085_CAL_MD            0xBE  // R   Calibration data (16 bits)
21
 
22
#define BMP085_CONTROL           0xF4
23
#define BMP085_TEMPDATA          0xF6
24
#define BMP085_PRESSUREDATA      0xF6
25
#define BMP085_READTEMPCMD       0x2E
26
#define BMP085_READPRESSURECMD   0x34
27
 
28
typedef struct {
29
    int ac1, ac2, ac3, b1, b2, mb, mc, md;
30
    unsigned int ac4, ac5, ac6;
31
    char oversampling;
32
} BMP085_DATA;
33
 
34
void BMP_Init(BMP085_DATA *data);
35
void BMP_Begin(char mode);
36
unsigned int BMP_Read_Raw_Temperature(void);
37
unsigned long BMP_Read_Raw_Pressure(void);
38
float BMP_Read_Temperature(void);
39
long BMP_Read_Pressure(void);
40
float BMP_Read_Altitude(float seaLevelPressure);
41
 
42
char BMP_Read8(char a);
43
unsigned int BMP_Read16(char a);
44
void BMP_Write8(char a, char d);
45
 
46
#endif	/* TEMP_BMP085_H */
47