LP-551 Remove popup - Increase neutral diff levels for alarm
[librepilot.git] / flight / pios / inc / pios_bmp280.h
blobd559f138b882dbeb72cf6f937c1a500cf0cb6018
1 /**
2 ******************************************************************************
3 * @addtogroup PIOS PIOS Core hardware abstraction layer
4 * @{
5 * @addtogroup PIOS_BMP280 BMP280 Functions
6 * @brief Hardware functions to deal with the altitude pressure sensor
7 * @{
9 * @file pios_bmp280.h
10 * @author The LibrePilot Team, http://www.librepilot.org Copyright (C) 2017.
11 * @brief BMP280 functions header.
12 * @see The GNU Public License (GPL) Version 3
14 *****************************************************************************/
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 3 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 * for more details.
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #ifndef PIOS_BMP280_H
32 #define PIOS_BMP280_H
33 #include <pios_sensors.h>
35 #define BMP280_OVERSAMP_SKIPPED (0x00)
36 #define BMP280_OVERSAMP_1X (0x01)
37 #define BMP280_OVERSAMP_2X (0x02)
38 #define BMP280_OVERSAMP_4X (0x03)
39 #define BMP280_OVERSAMP_8X (0x04)
40 #define BMP280_OVERSAMP_16X (0x05)
42 #define BMP280_PRESSURE_OSR(x) (x << 2)
43 #define BMP280_TEMPERATURE_OSR(x) (x << 5)
45 #define BMP280_STANDARD_RESOLUTION (BMP280_PRESSURE_OSR(BMP280_OVERSAMP_4X) | BMP280_TEMPERATURE_OSR(BMP280_OVERSAMP_1X))
46 #define BMP280_HIGH_RESOLUTION (BMP280_PRESSURE_OSR(BMP280_OVERSAMP_8X) | BMP280_TEMPERATURE_OSR(BMP280_OVERSAMP_1X))
47 #define BMP280_ULTRA_HIGH_RESOLUTION (BMP280_PRESSURE_OSR(BMP280_OVERSAMP_16X) | BMP280_TEMPERATURE_OSR(BMP280_OVERSAMP_2X))
49 struct pios_bmp280_cfg {
50 uint8_t oversampling;
53 /* Public Functions */
54 extern void PIOS_BMP280_Init(const struct pios_bmp280_cfg *cfg, uint32_t i2c_device);
56 #endif /* PIOS_BMP280_H */
58 /**
59 * @}
60 * @}