Paparazzi UAS  v5.18.0_stable
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;
67  bool initialized;
68  volatile bool data_available;
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
BMP085_STATUS_READ_PRESS
@ BMP085_STATUS_READ_PRESS
Definition: bmp085.h:39
bmp085_read_eeprom_calib
void bmp085_read_eeprom_calib(struct Bmp085 *bmp)
Definition: bmp085.c:73
uint16_t
unsigned short uint16_t
Definition: types.h:16
Bmp085EOC
bool(* Bmp085EOC)(void)
Definition: bmp085.h:60
Bmp085Calib::ac2
int16_t ac2
Definition: bmp085.h:45
Bmp085::status
enum Bmp085Status status
state machine status
Definition: bmp085.h:66
Bmp085Calib::ac1
int16_t ac1
Definition: bmp085.h:44
Bmp085Calib::mb
int16_t mb
Definition: bmp085.h:52
Bmp085::temperature
int32_t temperature
temperature in 0.1 deg Celcius
Definition: bmp085.h:72
Bmp085::calib
struct Bmp085Calib calib
Definition: bmp085.h:69
BMP085_STATUS_IDLE
@ BMP085_STATUS_IDLE
Definition: bmp085.h:35
Bmp085Calib::mc
int16_t mc
Definition: bmp085.h:53
Bmp085::i2c_trans
struct i2c_transaction i2c_trans
Definition: bmp085.h:64
Bmp085Calib::b2
int16_t b2
Definition: bmp085.h:51
Bmp085Calib::md
int16_t md
Definition: bmp085.h:54
Bmp085Calib::b1
int16_t b1
Definition: bmp085.h:50
std.h
Bmp085Calib::ac5
uint16_t ac5
Definition: bmp085.h:48
Bmp085::ut
int32_t ut
uncompensated temperature
Definition: bmp085.h:70
Bmp085::eoc
Bmp085EOC eoc
function to check End Of Conversion
Definition: bmp085.h:65
Bmp085::initialized
bool initialized
config done flag
Definition: bmp085.h:67
bmp085_event
void bmp085_event(struct Bmp085 *bmp)
Definition: bmp085.c:142
int16_t
signed short int16_t
Definition: types.h:17
uint8_t
unsigned char uint8_t
Definition: types.h:14
BMP085_STATUS_UNINIT
@ BMP085_STATUS_UNINIT
Definition: bmp085.h:34
i2c_transaction
I2C transaction structure.
Definition: i2c.h:93
Bmp085::i2c_p
struct i2c_periph * i2c_p
Definition: bmp085.h:63
BMP085_STATUS_START_PRESS
@ BMP085_STATUS_START_PRESS
Definition: bmp085.h:38
Bmp085::up
int32_t up
uncompensated pressure
Definition: bmp085.h:71
Bmp085Calib::b5
int32_t b5
Definition: bmp085.h:57
Bmp085::pressure
int32_t pressure
pressure in Pascal
Definition: bmp085.h:73
Bmp085Calib::ac6
uint16_t ac6
Definition: bmp085.h:49
Bmp085Status
Bmp085Status
Definition: bmp085.h:33
Bmp085::data_available
volatile bool data_available
data ready flag
Definition: bmp085.h:68
BMP085_STATUS_READ_TEMP
@ BMP085_STATUS_READ_TEMP
Definition: bmp085.h:37
int32_t
signed long int32_t
Definition: types.h:19
Bmp085Calib::ac4
uint16_t ac4
Definition: bmp085.h:47
bmp085_init
void bmp085_init(struct Bmp085 *bmp, struct i2c_periph *i2c_p, uint8_t addr)
Definition: bmp085.c:83
Bmp085
Definition: bmp085.h:62
Bmp085Calib
Definition: bmp085.h:42
i2c_periph
Definition: i2c.h:144
Bmp085Calib::ac3
int16_t ac3
Definition: bmp085.h:46
bmp085_periodic
void bmp085_periodic(struct Bmp085 *bmp)
Start new measurement if idle or read temp/pressure.
Definition: bmp085.c:108
i2c.h
BMP085_STATUS_START_TEMP
@ BMP085_STATUS_START_TEMP
Definition: bmp085.h:36