Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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)
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 
enum Bmp3Status status
state machine status
Definition: bmp3_i2c.h:41
struct bmp3_quantized_calib_data quant_calib
quantized calibration data
Definition: bmp3_i2c.h:46
void bmp3_i2c_init(struct Bmp3_I2c *bmp, struct i2c_periph *i2c_p, uint8_t addr)
init function
Definition: bmp3_i2c.c:60
Register Trim Variables.
Definition: bmp3_regs.h:151
void bmp3_i2c_read_eeprom_calib(struct Bmp3_I2c *bmp)
bool initialized
config done flag
Definition: bmp3_i2c.h:42
float pressure
pressure in Pascal
Definition: bmp3_i2c.h:50
void bmp3_i2c_periodic(struct Bmp3_I2c *bmp)
Start new measurement if sensor ready.
Definition: bmp3_i2c.c:78
uint32_t raw_pressure
uncompensated pressure
Definition: bmp3_i2c.h:48
uint32_t raw_temperature
uncompensated temperature
Definition: bmp3_i2c.h:49
void bmp3_i2c_event(struct Bmp3_I2c *bmp)
Definition: bmp3_i2c.c:125
Sensor driver for BMP3 sensor register definition.
float temperature
temperature in deg Celcius
Definition: bmp3_i2c.h:51
struct bmp3_reg_calib_data calib
calibration data
Definition: bmp3_i2c.h:44
struct i2c_transaction i2c_trans
Definition: bmp3_i2c.h:40
unsigned long uint32_t
Definition: types.h:18
I2C transaction structure.
Definition: i2c.h:93
unsigned char uint8_t
Definition: types.h:14
Bmp3Status
Status enum.
Definition: bmp3_regs.h:141
volatile bool data_available
data ready flag
Definition: bmp3_i2c.h:43
struct i2c_periph * i2c_p
Definition: bmp3_i2c.h:39
Quantized Trim Variables.
Definition: bmp3_regs.h:195
Architecture independent I2C (Inter-Integrated Circuit Bus) API.