This repository has been archived by the owner on Jul 16, 2023. It is now read-only.
forked from adafruit/Adafruit_BMP3XX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGCI_BMP3XX.h
64 lines (53 loc) · 1.75 KB
/
GCI_BMP3XX.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*!
* @file Adafruit_BMP3XX.h
*
* Adafruit BMP3XX temperature & barometric pressure sensor driver
*
* This is the documentation for Adafruit's BMP3XX driver for the
* Arduino platform. It is designed specifically to work with the
* Adafruit BMP388 breakout: https://www.adafruit.com/products/3966
*
* These sensors use I2C or SPI to communicate
*
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Written by Ladyada for Adafruit Industries.
*
* BSD license, all text here must be included in any redistribution.
*
*/
#ifndef __BMP3XX_H__
#define __BMP3XX_H__
#include "bmp3.h"
#include <stdint.h>
#include <Adafruit_I2CDevice.h>
/*=========================================================================
I2C ADDRESS/BITS
-----------------------------------------------------------------------*/
constexpr uint8_t BMP3XX_DEFAULT_ADDRESS {0x77}; ///< The default I2C address
/** Adafruit_BMP3XX Class for both I2C and SPI usage.
* Wraps the Bosch library for Arduino usage
*/
class GCI_BMP3XX {
public:
GCI_BMP3XX();
bool begin_I2C(
uint8_t addr = BMP3XX_DEFAULT_ADDRESS,
TwoWire *theWire = &Wire);
uint8_t chipID(void);
bool setTemperatureOversampling(uint8_t os);
bool setPressureOversampling(uint8_t os);
bool setIIRFilterCoeff(uint8_t fs);
bool setOutputDataRate(uint8_t odr);
/// Perform a reading in blocking mode
bool performReading(void);
/// Temperature (Celsius) assigned after calling performReading()
double temperature;
/// Pressure (Pascals) assigned after calling performReading()
double pressure;
private:
struct bmp3_dev the_sensor;
};
#endif