Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
bmp085.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 Martin Mueller
3  * Copyright (C) 2013 Felix Ruess <felix.ruess@gmail.com>
4  *
5  * This file is part of paparazzi.
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22 
27 #ifndef BMP085_H
28 #define BMP085_H
29 
30 #include "mcu_periph/i2c.h"
31 #include "std.h"
32 
40 };
41 
42 struct Bmp085Calib {
43  // These values come from EEPROM on sensor
55 
56  // These values are calculated
58 };
59 
60 typedef bool (*Bmp085EOC)(void);
61 
62 struct Bmp085 {
63  struct i2c_periph *i2c_p;
66  enum Bmp085Status status;
67  bool initialized;
68  volatile bool data_available;
69  struct Bmp085Calib calib;
74 };
75 
76 extern void bmp085_read_eeprom_calib(struct Bmp085 *bmp);
77 extern void bmp085_init(struct Bmp085 *bmp, struct i2c_periph *i2c_p, uint8_t addr);
78 extern void bmp085_periodic(struct Bmp085 *bmp);
79 extern void bmp085_event(struct Bmp085 *bmp);
80 
81 #endif
void bmp085_init(struct Bmp085 *bmp, struct i2c_periph *i2c_p, uint8_t addr)
Definition: bmp085.c:83
bool(* Bmp085EOC)(void)
Definition: bmp085.h:60
int32_t up
uncompensated pressure
Definition: bmp085.h:71
int16_t mb
Definition: bmp085.h:52
struct Bmp085Calib calib
Definition: bmp085.h:69
int16_t md
Definition: bmp085.h:54
int32_t pressure
pressure in Pascal
Definition: bmp085.h:73
void bmp085_event(struct Bmp085 *bmp)
Definition: bmp085.c:142
int32_t b5
Definition: bmp085.h:57
int16_t b2
Definition: bmp085.h:51
enum Bmp085Status status
state machine status
Definition: bmp085.h:66
Bmp085EOC eoc
function to check End Of Conversion
Definition: bmp085.h:65
int32_t temperature
temperature in 0.1 deg Celcius
Definition: bmp085.h:72
int16_t ac2
Definition: bmp085.h:45
int16_t b1
Definition: bmp085.h:50
int16_t ac3
Definition: bmp085.h:46
uint16_t ac6
Definition: bmp085.h:49
bool initialized
config done flag
Definition: bmp085.h:67
int32_t ut
uncompensated temperature
Definition: bmp085.h:70
uint16_t ac4
Definition: bmp085.h:47
void bmp085_read_eeprom_calib(struct Bmp085 *bmp)
Definition: bmp085.c:73
struct i2c_transaction i2c_trans
Definition: bmp085.h:64
int16_t mc
Definition: bmp085.h:53
struct i2c_periph * i2c_p
Definition: bmp085.h:63
volatile bool data_available
data ready flag
Definition: bmp085.h:68
int16_t ac1
Definition: bmp085.h:44
void bmp085_periodic(struct Bmp085 *bmp)
Start new measurement if idle or read temp/pressure.
Definition: bmp085.c:108
uint16_t ac5
Definition: bmp085.h:48
Bmp085Status
Definition: bmp085.h:33
@ BMP085_STATUS_UNINIT
Definition: bmp085.h:34
@ BMP085_STATUS_START_TEMP
Definition: bmp085.h:36
@ BMP085_STATUS_IDLE
Definition: bmp085.h:35
@ BMP085_STATUS_READ_TEMP
Definition: bmp085.h:37
@ BMP085_STATUS_READ_PRESS
Definition: bmp085.h:39
@ BMP085_STATUS_START_PRESS
Definition: bmp085.h:38
Definition: bmp085.h:62
I2C transaction structure.
Definition: i2c.h:93
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83
short int16_t
Typedef defining 16 bit short type.
Definition: vl53l1_types.h:93
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98