Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
bmp280_i2c.h
Go to the documentation of this file.
1 /*
2  * Chris Efstathiou hendrixgr@gmail.com
3  * This file is part of paparazzi.
4  *
5  * paparazzi is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2, or (at your option)
8  * any later version.
9  *
10  * paparazzi is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with paparazzi; see the file COPYING. If not, see
17  * <http://www.gnu.org/licenses/>.
18  */
19 
27 #ifndef BMP280_I2C_H
28 #define BMP280_I2C_H
29 
30 /* Header includes */
32 #include "mcu_periph/i2c.h"
33 
34 
35 struct Bmp280_I2c {
36  struct i2c_periph *i2c_p;
38  enum Bmp280Status status;
39  bool initialized;
40  volatile bool data_available;
44  float pressure;
45  float temperature;
46 };
47 
48 extern void bmp280_i2c_read_eeprom_calib(struct Bmp280_I2c *bmp);
49 extern void bmp280_i2c_init(struct Bmp280_I2c *bmp, struct i2c_periph *i2c_p, uint8_t addr);
50 extern void bmp280_i2c_periodic(struct Bmp280_I2c *bmp);
51 extern void bmp280_i2c_event(struct Bmp280_I2c *bmp);
52 
53 #endif /* BMP280_I2C_H */
void bmp280_i2c_event(struct Bmp280_I2c *bmp)
Definition: bmp280_i2c.c:104
bool initialized
config done flag
Definition: bmp280_i2c.h:39
void bmp280_i2c_periodic(struct Bmp280_I2c *bmp)
Definition: bmp280_i2c.c:57
uint32_t raw_temperature
uncompensated temperature
Definition: bmp280_i2c.h:43
float pressure
pressure in Pascal
Definition: bmp280_i2c.h:44
float temperature
temperature in deg Celcius
Definition: bmp280_i2c.h:45
volatile bool data_available
data ready flag
Definition: bmp280_i2c.h:40
struct i2c_transaction i2c_trans
Definition: bmp280_i2c.h:37
struct bmp280_reg_calib_data calib
calibration data
Definition: bmp280_i2c.h:41
enum Bmp280Status status
state machine status
Definition: bmp280_i2c.h:38
void bmp280_i2c_init(struct Bmp280_I2c *bmp, struct i2c_periph *i2c_p, uint8_t addr)
Definition: bmp280_i2c.c:41
void bmp280_i2c_read_eeprom_calib(struct Bmp280_I2c *bmp)
uint32_t raw_pressure
uncompensated pressure
Definition: bmp280_i2c.h:42
struct i2c_periph * i2c_p
Definition: bmp280_i2c.h:36
Bmp280Status
Status enum.
Definition: bmp280_regs.h:148
I2C transaction structure.
Definition: i2c.h:93
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98