Loading...
Searching...
No Matches
bmp180.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Inria
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
22
23#include "saul.h"
24#include "periph/i2c.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
33typedef enum {
34 BMP180_ULTRALOWPOWER = 0,
35 BMP180_STANDARD,
36 BMP180_HIGHRES,
37 BMP180_ULTRAHIGHRES
39
43typedef struct {
44 int16_t ac1;
45 int16_t ac2;
46 int16_t ac3;
47 int16_t b1;
48 int16_t b2;
49 int16_t mb;
50 int16_t mc;
51 int16_t md;
52 uint16_t ac4;
53 uint16_t ac5;
54 uint16_t ac6;
56
65
73
77enum {
81};
82
93int bmp180_init(bmp180_t *dev, const bmp180_params_t *params);
94
103
111uint32_t bmp180_read_pressure(const bmp180_t *dev);
112
121int16_t bmp180_altitude(const bmp180_t *dev, uint32_t pressure_0);
122
131uint32_t bmp180_sealevel_pressure(const bmp180_t *dev, int16_t altitude);
132
133#ifdef __cplusplus
134}
135#endif
136
Definition of the generic [S]ensor [A]ctuator [U]ber [L]ayer.
int16_t bmp180_altitude(const bmp180_t *dev, uint32_t pressure_0)
Compute altitude, returned in m.
uint32_t bmp180_sealevel_pressure(const bmp180_t *dev, int16_t altitude)
Compute pressure at sea level, returned in Pa.
uint32_t bmp180_read_pressure(const bmp180_t *dev)
Read pressure value from the given BMP180 device, returned in Pa.
int bmp180_init(bmp180_t *dev, const bmp180_params_t *params)
Initialize the given BMP180 device.
int16_t bmp180_read_temperature(const bmp180_t *dev)
Read temperature value from the given BMP180 device, returned in d°C.
bmp180_oversampling_mode_t
Oversampling modes.
Definition bmp180.h:33
@ BMP180_OK
everything was fine
Definition bmp180.h:78
@ BMP180_ERR_NOCAL
error when reading calibration values
Definition bmp180.h:80
@ BMP180_ERR_NODEV
did not detect BMP180
Definition bmp180.h:79
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition i2c.h:155
Low-level I2C peripheral driver interface definition.
Calibration struct for the BMP180 sensor.
Definition bmp180.h:43
uint16_t ac6
ac6 coefficient
Definition bmp180.h:54
int16_t b1
b1 coefficient
Definition bmp180.h:47
int16_t b2
b2 coefficient
Definition bmp180.h:48
int16_t md
md coefficient
Definition bmp180.h:51
int16_t mc
mc coefficient
Definition bmp180.h:50
int16_t mb
mb coefficient
Definition bmp180.h:49
int16_t ac2
ac2 coefficient
Definition bmp180.h:45
uint16_t ac4
ac4 coefficient
Definition bmp180.h:52
uint16_t ac5
ac5 coefficient
Definition bmp180.h:53
int16_t ac3
ac3 coefficient
Definition bmp180.h:46
int16_t ac1
ac1 coefficient
Definition bmp180.h:44
Device initialization parameters.
Definition bmp180.h:60
bmp180_oversampling_mode_t oversampling
Oversampling mode.
Definition bmp180.h:63
i2c_t i2c_dev
I2C device which is used.
Definition bmp180.h:61
uint8_t i2c_addr
I2C address.
Definition bmp180.h:62
Device descriptor for the BMP180 sensor.
Definition bmp180.h:69
bmp180_params_t params
Device initialization parameters.
Definition bmp180.h:70
bmp180_calibration_t calibration
Device calibration.
Definition bmp180.h:71