Paparazzi UAS  v5.18.0_stable
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;
42  bool initialized;
43  volatile bool data_available;
45 #if (BMP3_COMPENSATION == BMP3_DOUBLE_PRECISION_COMPENSATION) || ( BMP3_COMPENSATION == BMP3_SINGLE_PRECISION_COMPENSATION)
46  struct bmp3_quantized_calib_data quant_calib;
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 
Bmp3_I2c::temperature
float temperature
temperature in deg Celcius
Definition: bmp3_i2c.h:51
Bmp3_I2c::i2c_trans
struct i2c_transaction i2c_trans
Definition: bmp3_i2c.h:40
uint32_t
unsigned long uint32_t
Definition: types.h:18
bmp3_i2c_read_eeprom_calib
void bmp3_i2c_read_eeprom_calib(struct Bmp3_I2c *bmp)
bmp3_i2c_periodic
void bmp3_i2c_periodic(struct Bmp3_I2c *bmp)
Start new measurement if sensor ready.
Definition: bmp3_i2c.c:78
Bmp3_I2c::status
enum Bmp3Status status
state machine status
Definition: bmp3_i2c.h:41
Bmp3_I2c::i2c_p
struct i2c_periph * i2c_p
Definition: bmp3_i2c.h:39
Bmp3_I2c::calib
struct bmp3_reg_calib_data calib
calibration data
Definition: bmp3_i2c.h:44
bmp3_i2c_event
void bmp3_i2c_event(struct Bmp3_I2c *bmp)
Definition: bmp3_i2c.c:125
uint8_t
unsigned char uint8_t
Definition: types.h:14
Bmp3_I2c::data_available
volatile bool data_available
data ready flag
Definition: bmp3_i2c.h:43
Bmp3Status
Bmp3Status
Status enum.
Definition: bmp3_regs.h:141
Bmp3_I2c::raw_pressure
uint32_t raw_pressure
uncompensated pressure
Definition: bmp3_i2c.h:48
i2c_transaction
I2C transaction structure.
Definition: i2c.h:93
Bmp3_I2c::raw_temperature
uint32_t raw_temperature
uncompensated temperature
Definition: bmp3_i2c.h:49
bmp3_i2c_init
void bmp3_i2c_init(struct Bmp3_I2c *bmp, struct i2c_periph *i2c_p, uint8_t addr)
init function
Definition: bmp3_i2c.c:60
Bmp3_I2c
Definition: bmp3_i2c.h:38
i2c_periph
Definition: i2c.h:144
i2c.h
bmp3_reg_calib_data
Register Trim Variables.
Definition: bmp3_regs.h:151
Bmp3_I2c::quant_calib
struct bmp3_quantized_calib_data quant_calib
quantized calibration data
Definition: bmp3_i2c.h:46
bmp3_regs.h
Sensor driver for BMP280 sensor register definition.
Bmp3_I2c::initialized
bool initialized
config done flag
Definition: bmp3_i2c.h:42
Bmp3_I2c::pressure
float pressure
pressure in Pascal
Definition: bmp3_i2c.h:50