BMP180.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: Beerware
2 /**
3  * @file BMP180.h
4  * @brief Digital pressure sensor driver
5  * @ingroup BMP180
6  */
7 #pragma once
8 
9 #ifdef USE_BMP180
10 
11 #define BMP180_CHIP_ID 0x55 ///< Chip ID
12 #define BMP180_ADDRESS_READ 0xEF ///< Device address for read operations
13 #define BMP180_ADDRESS_WRITE 0xEE ///< Device address for write operations
14 
15 #include <stdint.h>
16 
17 /**
18  * @brief Hardware pressure sampling accuracy modes
19  * @details Control registers values for different internal
20  * oversampling_setting (oss)
21  */
22 typedef enum
23 {
24  OSS_TEMPERATURE = 0x2E, ///< Temperature, max conversion time 4.5ms
25  OSS_PRESSURE_ULTRA_LOW_PWR = 0x34, ///< Ultra low power, max. conversion time 4.5ms, 3uA
26  OSS_PRESSURE_DEFAULT = 0x74, ///< Standard, max. conversion time 7.5ms, 5uA
27  OSS_PRESSURE_HIGH_RES = 0xB4, ///< High resolution, max. conversion time 13.5ms, 7uA
28  OSS_PRESSURE_ULTRA_HIGH_RES = 0xF4 ///< Ultra-high resolution, max conversion time 25.5ms, 12uA
29 
31 
32 int BMP180_Init(void);
33 int BMP180_ReadTemperature(int8_t* ps8Temp);
34 
35 #endif // USE_BMP180
int BMP180_Init(void)
Initialise BMP180 driver.
Definition: BMP180.c:90
@ OSS_PRESSURE_DEFAULT
Standard, max. conversion time 7.5ms, 5uA.
Definition: BMP180.h:26
@ OSS_PRESSURE_HIGH_RES
High resolution, max. conversion time 13.5ms, 7uA.
Definition: BMP180.h:27
@ OSS_PRESSURE_ULTRA_LOW_PWR
Ultra low power, max. conversion time 4.5ms, 3uA.
Definition: BMP180.h:25
BMP180_ControlRegValue
Hardware pressure sampling accuracy modes.
Definition: BMP180.h:22
@ OSS_TEMPERATURE
Temperature, max conversion time 4.5ms.
Definition: BMP180.h:24
@ OSS_PRESSURE_ULTRA_HIGH_RES
Ultra-high resolution, max conversion time 25.5ms, 12uA.
Definition: BMP180.h:28
int BMP180_ReadTemperature(int8_t *ps8Temp)
Read current temperature.
Definition: BMP180.c:132