Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
bmp3_i2c.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Gautier Hattenberger <gautier.hattenberger@enac.fr>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
31 #ifndef BMP3_I2C_H
32 #define BMP3_I2C_H
33 
34 /* Header includes */
35 #include "peripherals/bmp3_regs.h"
36 #include "mcu_periph/i2c.h"
37 
38 struct Bmp3_I2c {
39  struct i2c_periph *i2c_p;
41  enum Bmp3Status status;
42  bool initialized;
43  volatile bool data_available;
44  struct bmp3_reg_calib_data calib;
45 #if (BMP3_COMPENSATION == BMP3_DOUBLE_PRECISION_COMPENSATION) || ( BMP3_COMPENSATION == BMP3_SINGLE_PRECISION_COMPENSATION)
47 #endif
50  float pressure;
51  float temperature;
52 };
53 
54 extern void bmp3_i2c_read_eeprom_calib(struct Bmp3_I2c *bmp);
55 extern void bmp3_i2c_init(struct Bmp3_I2c *bmp, struct i2c_periph *i2c_p, uint8_t addr);
56 extern void bmp3_i2c_periodic(struct Bmp3_I2c *bmp);
57 extern void bmp3_i2c_event(struct Bmp3_I2c *bmp);
58 
59 
60 #endif /* BMP3_I2C_H */
61 
float temperature
temperature in deg Celcius
Definition: bmp3_i2c.h:51
struct bmp3_quantized_calib_data quant_calib
quantized calibration data
Definition: bmp3_i2c.h:46
struct i2c_periph * i2c_p
Definition: bmp3_i2c.h:39
void bmp3_i2c_event(struct Bmp3_I2c *bmp)
Definition: bmp3_i2c.c:125
bool initialized
config done flag
Definition: bmp3_i2c.h:42
void bmp3_i2c_read_eeprom_calib(struct Bmp3_I2c *bmp)
enum Bmp3Status status
state machine status
Definition: bmp3_i2c.h:41
void bmp3_i2c_periodic(struct Bmp3_I2c *bmp)
Start new measurement if sensor ready.
Definition: bmp3_i2c.c:78
void bmp3_i2c_init(struct Bmp3_I2c *bmp, struct i2c_periph *i2c_p, uint8_t addr)
init function
Definition: bmp3_i2c.c:60
volatile bool data_available
data ready flag
Definition: bmp3_i2c.h:43
struct i2c_transaction i2c_trans
Definition: bmp3_i2c.h:40
float pressure
pressure in Pascal
Definition: bmp3_i2c.h:50
struct bmp3_reg_calib_data calib
calibration data
Definition: bmp3_i2c.h:44
uint32_t raw_temperature
uncompensated temperature
Definition: bmp3_i2c.h:49
uint32_t raw_pressure
uncompensated pressure
Definition: bmp3_i2c.h:48
Sensor driver for BMP280 sensor register definition.
Bmp3Status
Status enum.
Definition: bmp3_regs.h:141
Quantized Trim Variables.
Definition: bmp3_regs.h:195
Register Trim Variables.
Definition: bmp3_regs.h:151
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