6 #define BMP085_I2C_ADDRESS 0x77
8 #define BMP085_CALIBRATION_DATA_START 0xAA
9 #define BMP085_CALIBRATION_DATA_LENGTH 22
11 #define BMP085_CHIP_ID_REG 0xD0
12 #define BMP085_VERSION_REG 0xD1
14 #define BMP085_CHIP_ID 0x55 /* 85 */
18 typedef u_int16_t u16;
23 struct bmp085_calibration_data {
31 /* Each client has this additional data */
34 struct i2c_client *client;
38 unsigned char version;
39 struct bmp085_calibration_data calibration;
40 unsigned long raw_temperature;
41 unsigned long raw_pressure;
42 unsigned char oversampling_setting;
43 unsigned long next_temp_measurement;
44 long b6; // calculated temperature correction coefficient
47 int open_bmp085(int adapter_nr, struct bmp085_data *data);
48 void close_bmp085(struct bmp085_data *data);
49 void set_oversampling(struct bmp085_data *data, unsigned char oversampling);
50 unsigned char get_oversampling(struct bmp085_data *data);
51 s32 get_temperature(struct bmp085_data *data);
52 s32 get_pressure(struct bmp085_data *data);